• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

onload and back button

 
Abhinav Srivastava
Ranch Hand
Posts: 354
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The only way is to set a session cookie saying that the pop up was opened.

Eric
 
Abhinav Srivastava
Ranch Hand
Posts: 354
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Add the cookie with JavaScript, not the server.

pseudo code




Eric
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic