Created
October 31, 2011 17:38
-
-
Save gabalis/1328111 to your computer and use it in GitHub Desktop.
A javascript to improve hashbrown — http://daneden.me/hashbrown/
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
// find all anchors in document | |
var allAnchors = document.getElementsByTagName('a'); | |
// read them one by one | |
for (var i = 0, oneAnchor; oneAnchor = allAnchors[i]; i++) { | |
// is href just a hash ? | |
if ( oneAnchor.href == '#' ) | |
{ | |
// replace with well behaved | |
oneAnchor.href = 'javascript:void(0);'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment