Created
October 18, 2019 09:52
-
-
Save Rahmanism/852df21b5e34e668a6fa5fd9909c58f4 to your computer and use it in GitHub Desktop.
Confirm leaving 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
<script type="text/javascript"> | |
window.onbeforeunload = function () { | |
if (is_there_unsaved_data()) { | |
return "Are you sure you want to navigate away?"; | |
} else { | |
return; | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment