搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

Learn More

Javascript exit popup in firefox

  • 1 回覆
  • 1 有這個問題
  • 4 次檢視
  • 最近回覆由 cor-el

more options

Hi, I am trying to use a javascript exit alert box, i tested it in all other browsers and it is not showing the exit popup text in firefox. Do you know how it can show the text in firefox. here is the code


<script type="text/javascript">

    window.onbeforeunload = function() { return "This is my text that should show in firefox"; }

</script>

Hi, I am trying to use a javascript exit alert box, i tested it in all other browsers and it is not showing the exit popup text in firefox. Do you know how it can show the text in firefox. here is the code <script type="text/javascript"> window.onbeforeunload = function() { return "This is my text that should show in firefox"; } </script>

所有回覆 (1)

more options

Firefox has a dom.disable_beforeunload pref to disable this feature, so you can check this pref on the about:config page.

See also:

Since 25 May 2011, the HTML5 specification states that calls to window.alert(), window.confirm(), and window.prompt() methods may be ignored during this event. See the HTML5 specification for more details.