• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to cancel the unload event in a jsp

 
sobha mol
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65216
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can not force a person to stay on a page.

Eric
 
Sean Clark
Rancher
Posts: 377
Android Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic