[thelist] JavaScript to jump to the top of a page

Sarah Sweeney poohbear at designshift.com
Tue Dec 23 09:12:17 CST 2003

I'm looking for a JavaScript which will cause a page to go back to the 
top of a page. I have a site which I'm working on where a "Processing, 
please wait..." message shows up when you click on the Save button in a 
form (so that users don't get frustrated and click the Save button twice 
- they are very impatient). This is accomplished by hiding the main div 
that the page is in and showing a div with the processing message. But 
if the main div is long enough and the user is scrolled down the page 
when they click the save button, sometimes the processing message does 
not come into view when the Save button is clicked. So I'd like to make 
sure that the page jumps back to the top before the processing message 
appears. I tried:
   document.location = '#top';
but that didn't work. Does anyone have an idea of how to do this?



More information about the thelist mailing list