Why is the beforeunload event not triggered when the page window is closed? How to solve this?
PHP中文网2017-05-19 10:26:05
https://developer.mozilla.org...
The alert in this event will be ignored
仅有的幸福2017-05-19 10:26:05
For this rare event, it’s best to use jquery to test. If jquery doesn’t support it, it means the compatibility is extremely poor. Let’s change our thinking
滿天的星座2017-05-19 10:26:05
Browser compatibility
In IE6, IE7, IE8, it will be executed after refreshing the page, closing the browser, and after page jump;
IE9 will execute page refresh, but page jump and browser closing will not execute;
firefox (including firefox3.6) can be executed after closing the tag, after page jump, and after refreshing the page, but it cannot be executed after closing the browser;
Safari will be executed after refreshing the page and page jump, but it will not be executed after closing the browser;
Opera and Chrome will not be executed under any circumstances.