By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,568 Members | 1,196 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,568 IT Pros & Developers. It's quick & easy.

Killing browser event...

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
"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.