Any javascript to prompt a message box when a user closes IE? I have tried to find a code sample for quite a while but failed.
thanks in advance, George
Here is my html code, but it has the following error. Any ideas?
To help protect your security, Internet Explorer has restricted this webpage from running scripts or ActiveX controls that could access your computer. Click here for options...
You will get unload message during refresh also. Better to check clientx and clientY also in the beforeunload. This is a pseudo code...
You are looking for the
beforeunload
event.For example:
On a side note, I would seriously consider whether you want to do this. When I close the window, I'm done with your site, I don't want any more messages from you. Popping up an extra window is going to annoy a lot of people.
or the onUnload? -> http://www.w3schools.com/jsref/jsref_onunload.asp