Created
April 24, 2012 11:25
-
-
Save jcartledge/2478891 to your computer and use it in GitHub Desktop.
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 querystring(str) { | |
var qs = {}; | |
str.match(/^[\?]?(.*)$/)[1].split('&').map(function(pair) { | |
pair = pair.split('='); | |
qs[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]); | |
}); | |
return qs; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment