Created
September 12, 2011 19:59
-
-
Save fael/1212224 to your computer and use it in GitHub Desktop.
Get 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
//I found it @ util.js / chrome 16. | |
function parseQueryParams(location) { | |
var params = {}; | |
var query = unescape(location.search.substring(1)); | |
var vars = query.split("&"); | |
for (var i=0; i < vars.length; i++) { | |
var pair = vars[i].split("="); | |
params[pair[0]] = pair[1]; | |
} | |
return params; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment