Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save heapwolf/503772 to your computer and use it in GitHub Desktop.
Save heapwolf/503772 to your computer and use it in GitHub Desktop.
function queryString2JSON() {
var query = {}
unescape(window.location.search).replace(/[^&\?]+/g, function(a, b) {
var c = a.split("=");
query[c[0]] = c[1];
});
return query;
}
queryString2JSON();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment