Two Laptop Bag*
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
Author

how to cancel the unload event in a jsp

sobha mol
Greenhorn

Joined: Sep 19, 2009
Posts: 1
hi,
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
Marshal

Joined: Jan 10, 2002
Posts: 60782
    
  65

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] [Bear's FrontMan] [About Bear] [Books by Bear]
Eric Pascarello
author
Rancher

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

Eric
Sean Clark
Rancher

Joined: Jul 15, 2009
Posts: 377

Hey,

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.

Sean


I love this place!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to cancel the unload event in a jsp
 
Similar Threads
need event occure after click on dialog button
the function cancle() on jsp does not return control back to actionc lass
Validation in JSF
need event occure after click on dialog button
calling function while re postingthe same page..javascript