Skip to content

Instantly share code, notes, and snippets.

@maxp
Created August 1, 2017 05:34
Show Gist options
  • Save maxp/b97f8f61b0abc57d7d19b270cd2ecb3d to your computer and use it in GitHub Desktop.
Save maxp/b97f8f61b0abc57d7d19b270cd2ecb3d to your computer and use it in GitHub Desktop.
parse query string parameters
function parse_qs()
{
var parsedParameters = {};
var qs = location.search.substr(1);
var uriParameters = qs.split('&');
for (var i = 0; i < uriParameters.length; i++)
{
var p = uriParameters[i].split('=');
parsedParameters[p[0]] = decodeURIComponent(p[1]);
}
return parsedParameters;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment