• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Browser back button click

 
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Guys,

Is there a way wherein I show a alert when the user clicks the back button and it the alert dialog, show Ok and Cancel wherein Cancel will do nothing and Ok will take me back? Am I violating any laws of the universe by doing this? Is my way of handling the back button functionality wrong?

What I have is a web page which has a couple of buttons and on click of those buttons, I just refresh a div in that page. Eventually it is a series of steps and when the user is in say 5th step, and he clicks back, he looses all what he has done till Step 5 and I do not want this to happen. Also I have a session maintained (of course I have a time out to kill it), I do not want stale sessions to sit in my memory.

Suggestions on how to handle this?
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is no way of knowing if the back button was clicked or if the user closes the window.

Eric
 
reply
    Bookmark Topic Watch Topic
  • New Topic