Prohledat stránky podpory

Vyhněte se podvodům. Za účelem poskytnutí podpory vás nikdy nežádáme, abyste zavolali nebo poslali SMS na nějaké telefonní číslo nebo abyste sdělili své osobní údaje. Jakékoliv podezřelé chování nám prosím nahlaste pomocí odkazu „Nahlásit zneužití“.

Learn More

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

Všechny odpovědi (1)

more options

Could you try the code pattern in this article:

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