<p>I'm trying to make it so when a user scrolls down a page, click a link, do whatever it is they need to do, and then come back to the pages w/ links, they are at the same (x-y) location in the browser they were before.  How do I do that?</p>

<p>I'm a DOM Newbie so I don't know too much about how to do this.  </p>

<p>Target Browsers: IE6/7/8, Firefox 2/3, Opera, Safari</p>

<p>Added: I'm using a program called JQuery to help me learn</p>

[{'answer_id': 67697, 'author': 'YonahW', 'author_id': 3821, 'author_profile': 'https://Stackoverflow.com/users/3821', 'pm_score': -1, 'selected': False, 'text': '<p>you can use offsetLeft and offsetTop</p>\n'}, {'answer_id': 67717, 'author': 'Lucas Oman', 'author_id': 6726, 'author_profile': 'https://Stackoverflow.com/users/6726', 'pm_score': 0, 'selected': False, 'text': '<p>Try <a href="http://www.codelifter.com/main/javascript/capturemouseposition1." rel="nofollow noreferrer">this</a> or <a href="http://snipplr.com/view/3032/get-mouse-position-from-quirksmodeorg/" rel="nofollow noreferrer">this</a>.</p>\n'}, {'answer_id': 67733, 'author': 'pilsetnieks', 'author_id': 6615, 'author_profile': 'https://Stackoverflow.com/users/6615', 'pm_score': 0, 'selected': False, 'text': '<p>As far as I recall, the code for getting the viewport position differs between browsers, so it would be easier to use some kind of framework, for example, <a href="http://prototypejs.org/api/document/viewport" rel="nofollow noreferrer">Prototype</a> has a function document.viewport.getScrollOffsets (which, I believe, is the one you\'re after).</p>\n<p>However, getting the coordinates is only one part, the other would be doing something with them later. In this case you could add event listener to window.unload event, when that one fires, save the location in a cookie and later, when the user opens the page again, check whether that cookie is present and scroll accordingly.</p>\n<p>Though if all you care about is getting the user back to the place he was when he comes to the page via the browser\'s Back button, don\'t most browsers already do that automatically?</p>\n'}, {'answer_id': 68738, 'author': 'levik', 'author_id': 4465, 'author_profile': 'https://Stackoverflow.com/users/4465', 'pm_score': 0, 'selected': False, 'text': '<p>Usually, the browser will preserve the page viewport if you navigate away and then back (try it with any pages on your favorite news site). The only exception to this is probably if you adjust your cache settings to re-download and re-render the page each time.</p>\n\n<p>Not doing that (that is, not setting your page to never be cached) is probably the easiest, least obtrusive way to solve your problem.</p>\n'}, {'answer_id': 127998, 'author': 'deepwell', 'author_id': 21473, 'author_profile': 'https://Stackoverflow.com/users/21473', 'pm_score': 2, 'selected': False, 'text': '<p>To get the x-y location of where a user clicked on a page, use the following jQuery code:</p>\n\n<pre><code>&lt;html&gt;\n    &lt;head&gt;\n        &lt;script type="text/javascript" src="jquery.js"&gt;&lt;/script&gt;\n        &lt;script type="text/javascript"&gt;\n            jQuery(document).ready(function(){\n                $("#special").click(function(e){\n                    $(\'#status2\').html(e.pageX +\', \'+ e.pageY);\n                }); \n            });\n        &lt;/script&gt;\n    &lt;/head&gt;\n    &lt;body&gt;\n        &lt;h2 id="status2"&gt;\n            0, 0\n        &lt;/h2&gt;\n        &lt;div style="width: 100px; height: 100px; background:#ccc;" id="special"&gt;\n            Click me anywhere!\n        &lt;/div&gt;\n    &lt;/body&gt;\n&lt;/html&gt;\n</code></pre>\n'}]
['https://Stackoverflow.com/questions/67682', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/10352/']