Hello, I want to display a confirm message 'Are you sure u want to quit ?', when user presses the [X] button. But, the onUnload() closes the window first and then displays the message. Is there any way to display the message first and close the window ???
Veena Rani
Ranch Hand
Joined: Mar 09, 2000
Posts: 34
posted
0
you can use onbeforeunload event in place of onUnload this will display the message before closing the window. But i dont think you can prevent the closing of window according to user respose to message displayed. Veena
Tejas Tambe
Ranch Hand
Joined: Oct 08, 2001
Posts: 47
posted
0
Thanks Veena, I tried the onbeforeunload event, and it works. I have found a solution on which I can stop the unload event, by returning false to onbeforeunload.
But the problem here is that, IE itselfs prompts a message saying,
Are you sure you want to navigate from the current page.
Is there any way to disable this message from IE ?
"Write beautiful code; then profile that beautiful code and make little bits of it uglier but faster." --The JavaPerformanceTuning.com team, Newsletter 039.