tdope21 Posted July 2, 2008 Share Posted July 2, 2008 Hey guys,Here's the problem we're facing...When a user exits one of our pages we need to confirm with them that "if you leave this page, all your info is lost. Continue? yes? no?"That's the easy part. The parts that we are struggling with is that we're not sure how to call one of our methods if they do click "yes, I want to cancel". We have a delete method that will erase the data up to that point. And if they try to navigate away from that page, how to let them go. So if they type in a URL, how to pop the confirm box, hit our delete method, then let them go surf where ever they desire.Out of all of the examples that I've seen online the OnBeforeUnload seems like the best way to go, but we're just not sure how to get it to work the way that we need.I'm mainly doing this research for a comrad of mine and I don't have access to the code or else I would've sent what I had for you guys to pick through. I just know that it's been something that has been a pain in the neck to figure out.Help, thoughts, strong drink, all appreciated. Link to comment Share on other sites More sharing options...
Ingolme Posted July 2, 2008 Share Posted July 2, 2008 I believe onbeforeunload is used in Internet Explorer and onunload is the event used in other browsers. I'm not entirely sure, I haven't worked with them in a long time. Link to comment Share on other sites More sharing options...
shadowayex Posted July 4, 2008 Share Posted July 4, 2008 I thought it was onunload. In fact, I've used onunload before and it works in Firefox. I'm not sure about IE. IE isn't that great of a browser... Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.