Skip to content

Instantly share code, notes, and snippets.

@enagorny
Created January 17, 2012 10:55
Show Gist options
  • Save enagorny/1626212 to your computer and use it in GitHub Desktop.
Save enagorny/1626212 to your computer and use it in GitHub Desktop.
JS GET parameters as dict
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