jQuery in Action, 3rd edition
The moose likes HTML, CSS and JavaScript and the fly likes DHTML and 'back' button ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "DHTML and Watch "DHTML and New topic

DHTML and 'back' button ?

Sol Mayer-Orn
Ranch Hand

Joined: Nov 13, 2002
Posts: 311

I'm using DHTML, but my page gets meesed up when clicking the "Back" button on the browser...

Example: say I have a 'select' control with a list of countries.
Whenever the selected country changes, I use DHTML to display the capitol of the selected country ( in some < span > in the page).

Full code:

This works fine, untill I navigate to another page, and then use "Back" to return to my page... when using 'back', the displayed capitol will always be 'London' regardless of the selected country...

Help would be appriciated.
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
You would probably have to use cookies and fire an event of window.onload

I agree. Here's the link: http://aspose.com/file-tools
subject: DHTML and 'back' button ?
It's not a secret anymore!