Skip to content

Instantly share code, notes, and snippets.

@grippado
Created July 25, 2013 17:17
Show Gist options
  • Save grippado/6081861 to your computer and use it in GitHub Desktop.
Save grippado/6081861 to your computer and use it in GitHub Desktop.
Getting URL Variables
function urlVarsGet() {
var vars = {};
var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi,
function(m,key,value) {
vars[key] = value;
});
return vars;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment