Created
December 19, 2012 10:33
-
-
Save jimmyhillis/4335817 to your computer and use it in GitHub Desktop.
Simple function to return the #hash_component and nothing else from a URL string which can contain as much or little of a URL in any order.
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 _hash(url_string) { | |
var a = document.createElement('A'); | |
a.href = url_string; | |
return a.hash.split('?')[0].split('&')[0]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment