Skip to content

Instantly share code, notes, and snippets.

@fael
Created September 12, 2011 19:59
Show Gist options
  • Save fael/1212224 to your computer and use it in GitHub Desktop.
Save fael/1212224 to your computer and use it in GitHub Desktop.
Get Query String parameters
//I found it @ util.js / chrome 16.
function parseQueryParams(location) {
var params = {};
var query = unescape(location.search.substring(1));
var vars = query.split("&");
for (var i=0; i < vars.length; i++) {
var pair = vars[i].split("=");
params[pair[0]] = pair[1];
}
return params;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment