Skip to content

Instantly share code, notes, and snippets.

@stevenbey
Created June 22, 2012 11:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stevenbey/2972204 to your computer and use it in GitHub Desktop.
Save stevenbey/2972204 to your computer and use it in GitHub Desktop.
Add QueryString to your JavaScript location object.
(function() {
var querystring = {};
window.location.search.replace(
/([^?=&]+)(=([^&]*))?/g,
function($0, $1, $2, $3) { querystring[$1] = $3; });
window.location.querystring = querystring;
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment