tags:

views:

33

answers:

1

i am using confirm dialogue box on the window.onunload event.but when i click the cancel button it will navigate me to another page but i want to stay on that page. is this a problem of window.onunload event. please give me solution for this problem. also tell me another window event instead of it.But i do not want to use onbeforeunload event

+1  A: 

If you use onunload (rather than onbeforeunload) you can't prevent the page unloading because that event is fired after the browser has committed to unloading the page.

This is why unbeforeunload was invented.

This conversation may give you some more insights: http://codingforums.com/showthread.php?t=153514

thomasrutter
ok.thanks but i want to give my custom message on the onbeforeunload dialog box .I want toi override the message in the dialog box.How will i do that?
Lock up
can you help me? i need it immediatly?
Lock up
That sounds like a separate question. I'm sure people would be happy to help you but I don't know the answer.
thomasrutter