We're calling on all EU-based Mozillians with iOS or iPadOS devices to help us monitor Apple’s new browser choice screens. Join the effort to hold Big Tech to account!

搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

I need to pop up an alert while closing my application in firefox and I am using the latest version of fire fox. I used unload,onbeforeunload But nothing works

more options

I have used the following code:

       var myEvent = window.attachEvent || window.addEventListener;
       var chkevent = window.attachEvent ? 'onbeforeunload' : 'beforeunload'; /// make IE7, IE8 compitable
       myEvent(chkevent, function(e) { // For >=IE7, Chrome, Firefox
           var confirmationMessage = 'Are you sure to leave the page?';  // a space
           (e || window.event).returnValue = confirmationMessage;
           return confirmationMessage;
       });
I have used the following code: var myEvent = window.attachEvent || window.addEventListener; var chkevent = window.attachEvent ? 'onbeforeunload' : 'beforeunload'; /// make IE7, IE8 compitable myEvent(chkevent, function(e) { // For >=IE7, Chrome, Firefox var confirmationMessage = 'Are you sure to leave the page?'; // a space (e || window.event).returnValue = confirmationMessage; return confirmationMessage; });

所有回复 (1)

more options

Could you try the code pattern in this article:

https://developer.mozilla.org/docs/Web/Events/beforeunload