onunload

Capturing result of window.onbeforeunload confirmation dialog

邮差的信 提交于 2019-11-26 21:34:11
问题 Is there a way to capture to result of the window.onbeforeunload confirmation dialog like the one below from Stack Overflow (this happens when leaving the 'Ask Question' page without posting the question)? This is how it appears in Chrome, I believe it's slightly different in other browsers, but you always have some form of yes/no buttons. Presumably if they're still on the offending page after the event has been triggered they chose to stay and you could probably figure this out by watching

Is the onbeforeunload event not supported on iPhone?

和自甴很熟 提交于 2019-11-26 17:23:51
问题 So, I've got a handy little bit of functionality in place in a jQuery Mobile app that lets the user know if he/she is navigating away from the page, as this will trigger a log off. In simplified form: $(window).bind('beforeunload', function() { return "Navigating away from this page will log you off. Are you sure you want to continue?"; }); $(window).unload(function() { logoff(); }); This works just great in both Safari and Chrome on my laptop. However, it doesn't appear to work on the iPhone

How to block pop-up coming from iframe?

风流意气都作罢 提交于 2019-11-26 14:22:18
问题 I'm embedding page that has an exit pop-up. When you close the page, it automatically launches a pop-up window. How to disable pop-ups coming from the iframe on exit? 回答1: If you are wanting to block something like POP up ads or something coming from a website you are showing in an IFRAME - it's fairly easy. Make a framefilter.php and javascriptfilter.php which your iframe points to. You can modify it to meet your needs such as the onload blah blah and etc. But as/is - it's been working fine

window.onunload is not working properly in Chrome browser. Can any one help me?

荒凉一梦 提交于 2019-11-26 13:40:06
I have written this code function winUnload() { alert("Unload Window"); MyMethod(); } window.onunload = function() { winUnload(); } This code is working fine in IE and Firefox. But this code is not working in Chrome. Both the statements alert("Unload Window"); and MyMethod(); are not working. There are some actions which are not working in chrome, inside of the unload event. Alert or confirm boxes are such things. But what is possible (AFAIK): Open popups (with window.open) - but this will just work, if the popup blocker is disabled for your site Return a simple string (in beforeunload event),

Can I pop up a confirmation dialog when the user is closing the window in Safari/Chrome?

五迷三道 提交于 2019-11-26 09:59:38
问题 In IE and FF, i can attach an event handler to onBeforeUnload, and by passing a string to a property of the event, the user will see a dialog asking him whether he wants to continue with the \"unloading\" (either closing the window or navigating away). Safari and Chrome don\'t support onBeforeUnload, and onUnload seems to be too late. Is there some way to replicate the same functionality in Safari/Chrome? NOTE: I\'m not trying to keep the user hostage. I know this is nagging and un-cool. In

window.onunload is not working properly in Chrome browser. Can any one help me?

試著忘記壹切 提交于 2019-11-26 05:54:22
问题 I have written this code function winUnload() { alert(\"Unload Window\"); MyMethod(); } window.onunload = function() { winUnload(); } This code is working fine in IE and Firefox. But this code is not working in Chrome. Both the statements alert(\"Unload Window\"); and MyMethod(); are not working. 回答1: There are some actions which are not working in chrome, inside of the unload event. Alert or confirm boxes are such things. But what is possible (AFAIK): Open popups (with window.open) - but