Skip to content

Instantly share code, notes, and snippets.

@gilbox
Created December 13, 2013 23:34
Show Gist options
  • Save gilbox/7953467 to your computer and use it in GitHub Desktop.
Save gilbox/7953467 to your computer and use it in GitHub Desktop.
Parse GET parameters from the current page's URL
function getURLParameter(name) {
return decodeURI(
(RegExp(name + '=' + '(.+?)(&|$)').exec(location.search)||[,null])[1]
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment