Created
June 26, 2014 20:04
-
-
Save leepro/4b4d7a19c7d7fed7e14f to your computer and use it in GitHub Desktop.
Hooking links
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 Anchors = document.getElementsByTagName("a"); | |
| for (var i = 0; i < Anchors.length ; i++) { | |
| Anchors[i].addEventListener("click", | |
| function (event) { | |
| event.preventDefault(); | |
| if (confirm('Are you sure?')) { | |
| window.location = this.href; | |
| } | |
| }, | |
| false); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment