aspose file tools *
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: 349

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: 15376
    
    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: 349



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: 15376
    
    6
Add the cookie with JavaScript, not the server.

pseudo code




Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: onload and back button