Last active
October 10, 2023 12:14
-
-
Save reatlat/fd49246e1bed573ed354ba8a9913d826 to your computer and use it in GitHub Desktop.
Enhance your website's debugging experience with prevent-reload-page.js
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(e) { | |
var message = "Your confirmation message goes here.", e = e || window.event; | |
// For IE and Firefox | |
if (e) { | |
e.returnValue = message; | |
} | |
// For Safari | |
return message; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment