Why js onunload is invoked when popup page opens?
问题 According to the documentation (I'm only using Firefox ) : https://developer.mozilla.org/en/DOM/window.onunload The unload event is raised when the document is unloaded. But my code below would trigger the alert even though the child window (i.e. variable name "win") has just been opened , not closed. alert("failed but still reload:" + win.isSuccess); "failed but still reload: undefined" My attention is to invoke that onunload when the child window is closed. What am I doing wrong here?? Code