Created
November 25, 2014 17:30
-
-
Save dhigginbotham/caa1dd30fbd1383897df 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() { | |
var params = {}, queries, temp, i, l; | |
var query = window.location.search; | |
var queryString = query.substring( query.indexOf('?') + 1 ); | |
// Split into key/value pairs | |
queries = queryString.split("&"); | |
// Convert the array of strings into an object | |
for ( i = 0, l = queries.length; i < l; i++ ) { | |
temp = queries[i].split('='); | |
params[temp[0]] = temp[1]; | |
} | |
return params; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment