Skip to content

Instantly share code, notes, and snippets.

@killa-kyle
Created December 11, 2015 21:53
Show Gist options
  • Save killa-kyle/365dc6e39b3da885bf28 to your computer and use it in GitHub Desktop.
Save killa-kyle/365dc6e39b3da885bf28 to your computer and use it in GitHub Desktop.
Query String
var vars = [], hash;
var q = document.URL.split('?')[1];
if(q != undefined){
q = q.split('&');
for(var i = 0; i < q.length; i++){
hash = q[i].split('=');
vars.push(hash[1]);
vars[hash[0]] = hash[1];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment