faqts : Computers : Programming : Languages : JavaScript : Event handling

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

14 of 28 people (50%) answered Yes
Recently 4 of 10 people (40%) answered Yes

Entry

In Netscape (4.x) I have a onUnload event handler..not able to set a cookie in this event handler ..can anyone please help with a solution ?? thanks.

Sep 28th, 2000 06:28
Alex Fenton, anupriya ramraj,


In some versions of Netscape 4.x, cookie setting may fail when used 
within an unload event if the event handler was declared in Javascript 
with something like:
window.onunload = mySetCookieFunction;
The exact same function may work fine if the event handler is declared 
as an attribute of the <BODY> tag, i.e.:
<BODY onUnload="mySetCookieFunction();">
I can't think of an explanation for this, but it seems to make a 
difference.