PDA

View Full Version : onUnload event not firing in Netscape4.72


learner
08-13-2002, 08:55 AM
Hi,

In the Unload event of body, I am trying to call a function. It is working fine in IE. The same is not working in Netscape when the browser is closed.

Code:

<html>
<head>
<script>
function test()
{
alert("Called");
}
</script>
</head>
<body onUnLoad="javascript:test()">
Test
</body>
</html>


Is there any other way to do a task when the browser is closed in Netscape.

Thanks...

glenngv
08-13-2002, 09:42 AM
onunload is not only triggered when browser is closed, it is also triggered when:
-the page has reloaded
-you type a URL on the address bar
-clicking a link to a URL in the current page

if you explain why do you want to do this, then we can help you easier.

adios
08-13-2002, 07:12 PM
http://www.faqts.com/knowledge_base/view.phtml/aid/13177