Skip to content

Instantly share code, notes, and snippets.

@gabalis
Created October 31, 2011 17:38
Show Gist options
  • Save gabalis/1328111 to your computer and use it in GitHub Desktop.
Save gabalis/1328111 to your computer and use it in GitHub Desktop.
A javascript to improve hashbrown — http://daneden.me/hashbrown/
// 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