This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes reload() method for location object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "reload() method for location object" Watch "reload() method for location object" New topic

reload() method for location object

Rudy Rusli
Ranch Hand

Joined: Jun 01, 2006
Posts: 114

I use reload() method for location object and I did something like this:

The problem is my page is really long and when I do the reload it will bring user back to the top of the page. Is there any way the reload will not bring the user back to the top?

Thanks in advance for the help.
~ Rudy ~
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15376
You would have to find a JavaScript code that will remember the user's scroll position on the page. Only real way around that issue other than looking into Ajax.

It is sorta covered in the JavaRanch Style Guide.
subject: reload() method for location object
Similar Threads
Page is Not Refreshing as Expected
Is there a way to automatically default a webpage to a specific area upon load?
Page reload after clicking on Browser back button
Logout servlet problem with back button
session handling