Created
January 17, 2012 10:55
-
-
Save enagorny/1626212 to your computer and use it in GitHub Desktop.
JS GET parameters as dict
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 urlGET(){ | |
var search = window.location.search.replace('?', '').split('&'); | |
var GET = new Array(); | |
for(var i=0; i<search.length; i+=1){ | |
search[i] = search[i].split('='); | |
GET[decodeURIComponent(search[i][0])] = decodeURIComponent(search[i][1]); | |
}; | |
return GET; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment