This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android 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: 15376
You would probably have to use cookies and fire an event of window.onload

I agree. Here's the link:
subject: DHTML and 'back' button ?
Similar Threads
Ajax, Struts, and a few pesky event based issues
Problem with xmlhttp.responseXML
dojo and javascript DOM issue
javascript help
Help needed with DOJO and JSP