Created
March 25, 2012 10:11
-
-
Save robhadfield/2192673 to your computer and use it in GitHub Desktop.
JS: check if hash present in url
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
if(window.location.hash) { | |
var hash = window.location.hash.substring(1); //Puts hash in variable, and removes the # character | |
alert (hash); | |
// hash found | |
} else { | |
// No hash found | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment