470,581 Members | 2,438 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,581 developers. It's quick & easy.

Killing browser event...

Mel
i have a popup window and need to execute a script of mine right before
closing.

i tried something like: onUnload='doit();' and nothing gets called when the
user clicks
on the X (kill) button on the browser

can someone help ?

thanks
Jul 20 '05 #1
1 1138
"Mel" <me*@redolive.com> writes:
i have a popup window and need to execute a script of mine right before
closing.
There is not way to do that consistently across browsers.
i tried something like: onUnload='doit();' and nothing gets called
when the user clicks on the X (kill) button on the browser
Exactly.
can someone help ?


In IE, you can use the "onbeforeunload" handler. That is called
*before* the window is closed, and can even request that the
closing is cancelled (although the user has the final word).

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

14 posts views Thread by Rob Meade | last post: by
2 posts views Thread by news.microsoft.com | last post: by
10 posts views Thread by Conrad Lender | last post: by
1 post views Thread by livre | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.