Where did you install Firefox from? Help Mozilla uncover 3rd party websites that offer problematic Firefox installation by taking part in our campaign. There will be swag, and you'll be featured in our blog if you manage to report at least 10 valid reports!

Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

Mulongo oyo etiyamaki na archive. Tuna motuna mosusu soki osengeli na lisalisi

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; });

All Replies (1)

more options

Could you try the code pattern in this article:

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