Skip to content

Instantly share code, notes, and snippets.

@bruno-c
Last active December 11, 2015 16:29
Show Gist options
  • Save bruno-c/4628167 to your computer and use it in GitHub Desktop.
Save bruno-c/4628167 to your computer and use it in GitHub Desktop.
Query string as hash.
function qshash(){
return location.search.replace('?', '').split("&")
.reduce(function(h, kv){ var v = kv.split('='); h[v[0]] = v[1]; return h; }, {});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment