Skip to content

Instantly share code, notes, and snippets.

@asus4
Created February 12, 2012 14:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save asus4/1808865 to your computer and use it in GitHub Desktop.
Save asus4/1808865 to your computer and use it in GitHub Desktop.
getUrlVars
function getUrlVars() {
var vars = [],
hash,
i,
hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
for(i = 0; i < hashes.length; i++) {
hash = hashes[i].split('=');
vars.push(hash[0]);
vars[hash[0]] = hash[1];
}
return vars;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment