This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes onload and back button Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "onload and back button" Watch "onload and back button" New topic
Author

onload and back button

Abhinav Srivastava
Ranch Hand

Joined: Nov 19, 2002
Posts: 352

A button is clicked on a page, the form is submitted and when the response comes back, a pop-up is opened using onload function.
The problem is that the pop-up is also opened when coming back to the page using the back button.
Any neat way this can be handled?
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15385
    
    6
The only way is to set a session cookie saying that the pop up was opened.

Eric
Abhinav Srivastava
Ranch Hand

Joined: Nov 19, 2002
Posts: 352



When I have this server side code (no explicit cache-control whatsoever oon the page) and I hit the back button I get 'Page Expired' error.
When I comment this piece out, the page opens with a popup.
What difference just adding a cookie (and never reading it) could make?
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15385
    
    6
Add the cookie with JavaScript, not the server.

pseudo code




Eric
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: onload and back button
 
It's not a secret anymore!