Created
November 9, 2012 23:22
-
-
Save esundahl/4048977 to your computer and use it in GitHub Desktop.
javascript function for parsing a url query string
This file contains hidden or 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 params (string) { | |
res = {}; | |
string.replace("?","").split('&').map( | |
function (q) { | |
var v = q.split('='); | |
res[v[0]] = v[1]; | |
}); | |
return res; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment