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
Post a Comment