Created
March 24, 2012 17:54
-
-
Save robhadfield/2185612 to your computer and use it in GitHub Desktop.
JS: hash substring
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
eg: URL: yayhooray.net/#foo!bar | |
var $str = window.location.hash; | |
var $substr = $str.split('!'); | |
alert($str); // #foo!bar | |
alert($substr[0]); // #foo | |
alert($substr[1]); // bar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment