File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes how to cancel the unload event in a jsp 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 "how to cancel the unload event in a jsp" Watch "how to cancel the unload event in a jsp" New topic

how to cancel the unload event in a jsp

sobha mol

Joined: Sep 19, 2009
Posts: 1
I have a jsp page .in that i have used the onunload event to track the back button.
in this case i am not able to cancle the event .means when i click the cancle button on the confirmation box .its not staying in the same page
plsssssssssss help urgent
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63858

Welcome to the Ranch.

First, a few things to help make the most out of your visits here.

Please read the articles linked to by the "Smart Questions" link in my sig below. In particular:

Please take the time to choose the correct forum for your posts. This forum is for questions on JSP, not JavaScript. For more information, please read this.

This post has been moved to a more appropriate forum.

Also, please refrain from using words such as "Urgent!" when posting. Your question is no more and no less important than anyone else's. In fact, by using the such terms, you you can delay or prevent useful response to your question. Please read this to find out why.

[Asking smart questions] [About Bear] [Books by Bear]
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
You can not force a person to stay on a page.

Sean Clark

Joined: Jul 15, 2009
Posts: 377


you cannot do this with the 'onunload' event but this can be done with the 'onbeforeunload' event.

By the time the 'onunload' event is fired you are already moving to a new page.


I love this place!
I agree. Here's the link:
subject: how to cancel the unload event in a jsp
It's not a secret anymore!