Created
January 22, 2014 07:02
-
-
Save cvan/8554591 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 parseQueryString(qs) { | |
if (!qs) { | |
return {}; | |
} | |
var chunks; | |
var result = []; | |
qs.split('&').forEach(function(val) { | |
chunks = val.split('='); | |
result.push({ | |
name: chunks[0], | |
value: decodeURIComponent(chunks[1] || '') | |
}); | |
}); | |
return result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment