Created
October 10, 2019 09:40
-
-
Save sudopower/710468d8182b1781d77b5929367f2466 to your computer and use it in GitHub Desktop.
Prevent Redirection by accidentally clicking on link
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
jQuery("a").click(function(e) { | |
var leave = confirm("Whoa ! 😮 I dare you press ok"); | |
if(leave){ | |
var really = confirm("Ok is for losers ! Cancel is FTW 😎"); | |
if(really){ | |
window.close(); | |
}else{ | |
event.preventDefault(); | |
} | |
} | |
else{ | |
event.preventDefault(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment