View Full Version : control in closing window
How can I put an alert when the user is trying to close the window?
I tried with onUnload, but the window is closed before the function associated is called.
07-11-2005, 06:25 PM
<body onunload="alert('You are closing this window');">
The onunload event is often disabled by various browsing softwares/plugins such as popup blockers due to abuse over the years. I would suggest using a different strategy to do whatever it is you are trying. As a general rule if there's onunload popups on a website, I do not return ;)
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.