Click to See Complete Forum and Search --> : unLoad Not Working In IE
doobster
09-16-2003, 05:31 PM
My <body onUnload="myFunction()">
This will not call myFunction in Internet Explorer, but it works fine in Netscape. Is there some sort of glitch or something?
requestcode
09-16-2003, 06:32 PM
Should work. Can we see your script? Maybe something there is causing the problem. Another thing to consider is your syntax. Netscape use to be finicky about it, possible IE is also. Try onunload or onUnLoad and see if that works.
doobster
09-16-2003, 06:48 PM
I tried the different variations. Did not work.
My code is:
<head>
<SCRIPT LANGUAGE="JavaScript">
function myFunction() {
alert("Hello");
}
</SCRIPT>
</head>
<body class=bar bgcolor="#6699CC" scroll=no onunload="myFunction()">
doobster
09-17-2003, 09:47 AM
No one knows why this won't work in Internet Explorer?
AdamGundry
09-17-2003, 10:32 AM
It works fine in IE 6.0 and Mozilla 1.4, and the code looks fine to me. Which version of IE are you having problems with?
Adam
doobster
09-17-2003, 12:17 PM
Internet Explorer: 6.00.2800.1203
AdamGundry
09-17-2003, 01:25 PM
I guess this could be to do with your security settings or something. As far as I can tell, the code is correct.
Adam