Is it possible in mobile safari to get notified when the user clicks on refresh button. I want to prevent users from accidentally leaving the page as they might have some unsaved data on the page. I have a code that shows a prompt in safari desktop but for touch safari it just does not show anything and refreshes the page.
Asked
Active
Viewed 697 times
1 Answers
1
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?

Community
- 1
- 1

Eran Medan
- 44,555
- 61
- 184
- 276