Skip to main content
Inspiring
September 11, 2007
질문

JavaScript "onunload" for Netscape

  • September 11, 2007
  • 2 답변들
  • 707 조회
Hi,

Netscape will not call the onUnload() event when the browser is closed by clicking on the "X" button in the top right corner of the browser window. Netscape will call the onUnload() event if the browser window is staying open but going to another URL.

Does anybody know if there's a way to make Netscape call the onUnload event when closing browser?

Thanks in advance!

이 주제는 답변이 닫혔습니다.

2 답변

Inspiring
September 11, 2007
It depends on the version of NN you are using and how you are using it. In 4.2 and earlier you could not capture the onUnload at all. In newer versions you actually can.
BUT if you are trying to use alerts in the script they will not work because they can not open before the browser closes and thus canceling the alert call.
Inspiring
September 12, 2007
quote:

Originally posted by: Dinghus
It depends on the version of NN you are using and how you are using it. In 4.2 and earlier you could not capture the onUnload at all. In newer versions you actually can.
BUT if you are trying to use alerts in the script they will not work because they can not open before the browser closes and thus canceling the alert call.


That's what I meant. Even in Netscape 7, I can't get the onunload fire when I close the browser by clicking the "X" button in the top right corner of the browser, neither does "onbeforeunload". Any suggestion?
Inspiring
September 11, 2007
Yeah, but probably not one you will like.

Call the Netscape developers and have them change this behavior in their
browser! Or can one do this themselves, I forget is the Netscape
browser open source now?

Of course once this has been done, you will need to get all the current
Netscape browser users to upgrade to this new version so they can access
your website the way you would like it used.