Created
April 28, 2015 08:18
-
-
Save ainsofs/f845eec0cc3829b73353 to your computer and use it in GitHub Desktop.
Jquery to prompt user to confirm that they want to leave the page
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(window).bind('beforeunload', function() { | |
var prompt = true; //if you dont return anything, the page will continue as normal | |
if (prompt) | |
return 'You have unsaved changes'; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ko custom binding - https://gist.github.com/codethug/4657291