Skip to content

Instantly share code, notes, and snippets.

@wenzhixin
Created June 20, 2013 15:36
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 wenzhixin/5823839 to your computer and use it in GitHub Desktop.
Save wenzhixin/5823839 to your computer and use it in GitHub Desktop.
function parse(search) {
var query = {},
params = search.substring(1).split('&');
for (var i = 0, l = params.length; i < l; i++) {
var p = params[i].split('=');
query[p[0]] = p[1] || '';
}
return query;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment