Skip to content

Instantly share code, notes, and snippets.

@esundahl
Created November 9, 2012 23:22
Show Gist options
  • Save esundahl/4048977 to your computer and use it in GitHub Desktop.
Save esundahl/4048977 to your computer and use it in GitHub Desktop.
javascript function for parsing a url query string
function params (string) {
res = {};
string.replace("?","").split('&').map(
function (q) {
var v = q.split('=');
res[v[0]] = v[1];
});
return res;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment