javascript - How can I ask users to confirm before leaving the page on iOS safari? -


this question has answer here:

i have:

window.onbeforeunload = confirmfirst;  function confirmfirst() {      return "leave page?";  }    

this can give users prompt confirm leaving page on major browsers, except on ios safari. how can make work?

i want implement users accidentally swipe right (back button) , left page after typing in long paragraphs on site. thank you!

what's wrong code right now? should job...
can using either regular js:

window.onbeforeunload = function(){   return 'leave page?'; }; 

or jquery:

$(window).bind('beforeunload', function(){      return 'leave page?';  }); 

useful?
is there alternative method use onbeforeunload in mobile safari?


Comments

Popular posts from this blog

android - Pass an Serializable object in AIDL -

How to provide Authorization & Authentication using Asp.net, C#? -

How to use Authorization & Authentication in Asp.net, C#? -