So, I have a handy little functionality in the jQuery Mobile application that allows the user to find out if he is moving from the page, as this will disable the log. In a 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 great in both Safari and Chrome on my laptop. However, it does not work on the iPhone simulator.
Is the mobile browser turned on in iOS (I know it's Safari, but presumably a different version) just doesn't support the beforeunload event? Is this true in general for mobile devices (in particular, Android)?
Dan tao
source share