Created
April 25, 2016 18:25
-
-
Save marcbacon/39a7dcbe8e800aa986e1f9c98909a66d to your computer and use it in GitHub Desktop.
Test for an anchored hash and save the hash to a variable.
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