Last active
August 8, 2017 17:25
-
-
Save abelorian/dc155ac8bc650f97f082dd4287a9a476 to your computer and use it in GitHub Desktop.
Wanna leave confirmation?
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
var inputsChanged = false; | |
$(document).on('change', 'table#products-table', function(){ | |
if(!inputsChanged){ | |
window.onbeforeunload = function(){ return "Do you want to leave this site?" }; | |
} | |
inputsChanged = true; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment