Re: Do JavaScript after window.close()
There is a slight modification for
my previous post. The conditions for the if statement there is inadequate. The bug occurs when refreshing the browser when the mouse is beyond the leftmost side of the window, a valid yet unanticipated negative value for the X. This is evident especially for dual monitors--like what I am using. Thus the new conditions are as follow:
if (window.event.clientX 0
&& window.event.clientY 0
&& (window.event.clientX -1000 || window.event.clientY -1000)) {
//do closing routine...
}The 1000 value is a safe value for anticipating the event that we really expect--i.e. closing the window. Apparently, values lower than that seem to cause erroneous triggering.
Read the complete post at http://alexrazon.blogspot.com/2007/02/re-do-javascript-after-windowclose.html