Last active
April 29, 2016 18:18
-
-
Save Reedyseth/b9ca0e73abe2f7fa5f5febb3f5535cef 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
/** | |
* This will parse a given URL into an Object. | |
* @author Reedyseth | |
* | |
* @param qs String The URL to be parse. | |
* @return elements Object With the variables and the values. | |
**/ | |
function parseQueryString(qs) { | |
var elements = {}; | |
var a = qs.split("&"); | |
var size = a.length; | |
var b; | |
for (var i = 0; i < size; i++) { | |
b = a[i].split("="); | |
elements[ b[0] ] = decodeURIComponent( b[1] ); | |
} | |
return elements; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment