Skip to content

Instantly share code, notes, and snippets.

@indexzero
Created August 1, 2010 21:06
Show Gist options
  • Save indexzero/503769 to your computer and use it in GitHub Desktop.
Save indexzero/503769 to your computer and use it in GitHub Desktop.
function parseQueryString(subject) {
var results = {};
var parser = /[^&\?]+/g;
var match = parser.exec(subject);
while (match != null) {
var parts = match[0].split('=');
results[parts[0]] = parts[1];
match = parser.exec(subject);
}
return results;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment