Created
August 1, 2017 05:34
-
-
Save maxp/b97f8f61b0abc57d7d19b270cd2ecb3d to your computer and use it in GitHub Desktop.
parse query string parameters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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