Show a prompt before page gets refreshed in mobile safari
The code you did is something like this?
$(window).bind('beforeunload', function() {
return "You have unsaved stuff";
});
It seems it doesn't work in mobile Safari
See this possible duplicate: Is there an alternative method to use onbeforeunload in mobile safari?
Onbeforeunload event support on iPad
This has been discussed previously here, and there are is some anecdotal evidence to say that it does work in some circumstances.
onbeforeunload in Opera
onbeforeunload
is now supported in Opera 15 based on the WebKit engine but not in any prior versions based on Presto.
Related Topics
In Angularjs, Any Inline JavaScript Code That Included in HTML Templates Doesn't Work
Convert Relative Path to Absolute Using JavaScript
Change Value of Input and Submit Form in JavaScript
How to Stop User from Printing Webpages? Using JavaScript or Jquery
React - Prevent Event Trigger on Parent from Child
What Is the Most Efficient Way to Parse a CSS Color in JavaScript
Jquery CSS Rendering - Works in Firefox, Not in Chrome
Capture Keys Typed on Android Virtual Keyboard Using JavaScript
How to Check for Null Values in JavaScript
JavaScript Callback When Iframe Is Finished Loading
How to View Events Fired on an Element in Chrome Devtools
What Is the Fastest or Most Elegant Way to Compute a Set Difference Using JavaScript Arrays
Include Jquery in the JavaScript Console
How to Get a Utc Timestamp in JavaScript
Why Do We Need to Use Radix Parameter When Calling Parseint