Created
October 14, 2013 08:55
-
-
Save kmlprtsng/6972889 to your computer and use it in GitHub Desktop.
Cancel Hyperlink click
This file contains 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
//<a href="#" onClick="return false;"> //Most accepted Solution | |
//<a href="javascript:void(0)"> ... </a> //Problem: breaks when linking images in IE | |
//return this from the method. | |
return false; | |
//or using jquery | |
e.stopPropagation(); //stop the event from bubbling | |
e.preventDefault(); // stop the default functionality | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment