If I am scrolled down on a page, how do I get it so after it refreshes that it scrolls back to the position I was at? Currently, it refreshes and leaves me at the top of the page.
@CrazyMerlinMar 01.2007 — #using purely javascript I can't see a way to do this.
you can set markers in your page and have the page go to them on demand, but as soon as you refresh the page you lose all javascript variables......unless:
you have your page split into 2 frames. The main frame uses 100% of the frame area and the other frame is there to store variables.
I used to use that method occasionally when I needed to store variables globally in javascript, while allowing the user to change page.
As the user scrolls down the page you can keep a check on where they are using properties like: document.documentElement.scrollTop + document.body.scrollTop for IE, or window.scrollY for other browsers.
Then when that frames document changes you run a function stored in the hidden frame that sets the position back as it was...or anywhere you like actually.
This is not a very clean way of doing what you want, but it will work.