Created
August 7, 2019 19:15
-
-
Save rounakdatta/49f5525652c4bbc3d5b01948d99823e0 to your computer and use it in GitHub Desktop.
Prevent accidental refreshes on webpages
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 = function () { | |
return "Leave this page ?"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment