Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

onunload event in netscape??

Status
Not open for further replies.

sourabhjha

Programmer
Jan 13, 2002
121
IN
does netscape handles the onunload event in a diff way.How can i make sure that the function i called in onunload event is completed while closing a netscape window.It is not happening with me.My version is NS7.0.Same works fine with IE.any workaround for netscape.
 
Netscape should support the onunload event. Please copy the code from your source and paste it here so we can properly dissect it.

Cheers,

Edward "Cut a hole in the door. Hang a flap. Criminy, why didn't I think of this earlier?!" -- inventor of the cat door
 
here it is..
function js_onUnload()
{
var form = this.document.forms[0];
window.open('','dummy','resizable=no,scrollbars=no,width=screen.availWidth,height=screen.availHeight');

form.action="close_edit.jsp";
form.method = "post";
form.target = "dummy";
form.submit();

}

..only if i have an alert stmt after form.submit inthe function above then only the action in the jsp gets completed....or else the window closes without running thru ther target jsp completely.Works fine in IE though.I guess the window onunload is too fast in netscape...throwing an alert gives other activities enought time....
Note that close_edit.jsp had window.close() event in body tag.So as that disappearas after executing jsp script...
 
Ah.

Netscape and Mozilla are very good at garbage collection. As the windows close, the program kills all the babies of that window, which includes your window.

In IE, an onclose event can pop up a window because IE is about as sloppy about garbage cleanup as you can imagine. It cleans up the pointers, but it doesn't actually clean up the window.

I posted something about this in
thread216-472154
in case that's any help.

Cheers,

Edward "Cut a hole in the door. Hang a flap. Criminy, why didn't I think of this earlier?!" -- inventor of the cat door
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top