Skip to content

Instantly share code, notes, and snippets.

@robhadfield
Created March 25, 2012 10:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robhadfield/2192673 to your computer and use it in GitHub Desktop.
Save robhadfield/2192673 to your computer and use it in GitHub Desktop.
JS: check if hash present in url
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