Created
April 24, 2012 07:59
-
-
Save yocontra/2477693 to your computer and use it in GitHub Desktop.
Tiny window.location parser javascript/coffee-script
This file contains hidden or 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
parseLocation = -> | |
out = {} | |
for key in window.location.search.substring(1).split "&" | |
pair = key.split "=" | |
out[pair[0]] = pair[1] | |
return out |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment