469,290 Members | 1,789 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

IE onunload no longer works when window closing!!?

Hi, well it appears (and please please correct me if I am wrong) that
since some IE patch (I am using 6.0.2800.1160 SP2) the browser no
longer calls the onunload handler when running outside of localhost
(but why??).
eg.
<html>
<script>
function mesg(){
alert("hello");
}
</script>
<body onunload="mesg()">
hello
</body>
</html>

if you put that on localhost, open it in IE and then close the browser
you should get the alert. However if you move it to some non localhost
server and repeat, there will be no alert.

This definately worked before (before some patch came along) - one
solution is to use onbeforeunload instead, but it is of course IE
only(?) :(

Anybody know why, or any different?

Thanks,
Jim

Jul 23 '05 #1
4 3506
jd*******@shaw.ca wrote:
if you put that on localhost, open it in IE and then close the browser
you should get the alert. However if you move it to some non
localhost server and repeat, there will be no alert.


Cannot confirm that here using a current MSIE 6.0.2900.2180 (SP2) and
http://www.innoline-systemtechnik.de/dhgm/onunload.html

The only change relating to onunload I find documented in MSDN is
that Window.open() is ignored onunload in MSIE 6 SP2.

ciao, dhgm
Jul 23 '05 #2
Thanks for replying - your page doesn't work for me either, I'm sure
it's not a setting local to me as it's been reported by a customer (on
several machines) aswell....

Maybe it was broken in v.2800. and fixed in v.2900 ?

Jim

Jul 23 '05 #3
jd*******@shaw.ca wrote:
Thanks for replying - your page doesn't work for me either, I'm sure
it's not a setting local to me as it's been reported by a customer (on
several machines) aswell....

Maybe it was broken in v.2800. and fixed in v.2900 ?


I tried Dietmar's link with IE 6.0.2800 on Win XP SP 1 and it
works fine, so that ain't it.

--
Rob
Jul 23 '05 #4
Thanks Rob, would other people please try Dietmar's link

http://www.innoline-systemtech*nik.d.../onunload.html

and post a message if you don't see an alert box when closing the
browser window.

I'm certain this is nothing specific to me, and I am sure many people
would need to know of the same issue.

Thanks,
Jim

Jul 23 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Julien | last post: by
1 post views Thread by Handi | last post: by
2 posts views Thread by chris in grimsby | last post: by
2 posts views Thread by sylvain | last post: by
pshm
12 posts views Thread by pshm | last post: by
7 posts views Thread by Michiel Rapati-Kekkonen | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.