Created
December 13, 2013 16:44
-
-
Save digitalhydra/7947184 to your computer and use it in GitHub Desktop.
execute something before user leave the page before unload javascript
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.onbeforeunload = confirmExit; | |
function confirmExit() | |
{ | |
return "You have attempted to leave this page. If you have made any changes to the fields without clicking the Save button, your changes will be lost. Are you sure you want to exit this page?"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment