Skip to content

Instantly share code, notes, and snippets.

@yocontra
Created April 24, 2012 07:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yocontra/2477693 to your computer and use it in GitHub Desktop.
Save yocontra/2477693 to your computer and use it in GitHub Desktop.
Tiny window.location parser javascript/coffee-script
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