Created
August 8, 2012 13:37
-
-
Save hugodias/3295080 to your computer and use it in GitHub Desktop.
Get page HASH with Javascript
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
function getHash() { | |
var hash = window.location.hash; | |
return hash.substring(1); // remove # | |
} | |
function getLinkTarget(link) { | |
return link.href.substring(link.href.indexOf('#')+1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment