PDA

View Full Version : onunload question


smokinguns
07-28-2009, 09:00 PM
Hey all,
I open a popup window from a parent window using this code and I have attached a unload event to this popup
var clist = window.open("mypage.php,"popupname","menubar=no,location=no,scrollbars=yes);
(detectBrowser()=='msie'?clist.attachEvent("onunload",callme):clist.addEventListener("unload",callme,false));


here is function callme:

function callme(){
alert("unloaded");
}

The thing is that in IE I get the alert when I close(i.e the page unloads) the pop-up ,
but in FF, I get the alert when the popup loads and unloads.
Why is this so?

mioot
07-30-2009, 06:37 AM
I think there is no way to do these like unload event in firefox.