Skip to content

Instantly share code, notes, and snippets.

@joseadrian
Created September 26, 2013 06:02
Show Gist options
  • Save joseadrian/6710383 to your computer and use it in GitHub Desktop.
Save joseadrian/6710383 to your computer and use it in GitHub Desktop.
GET en javascript
var GET = function () {
var vars = {},
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