1

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.

babibo
  • 305
  • 1
  • 8
  • possible duplicate of [Is there an alternative method to use onbeforeunload in mobile safari?](http://stackoverflow.com/questions/6205989/is-there-an-alternative-method-to-use-onbeforeunload-in-mobile-safari) – Eran Medan May 17 '12 at 01:50

1 Answers1

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