This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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 ???
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
Joined: Oct 08, 2001
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 ?