Skip to content

Instantly share code, notes, and snippets.

@reactormade
Created December 10, 2012 19:00
Show Gist options
  • Save reactormade/4252567 to your computer and use it in GitHub Desktop.
Save reactormade/4252567 to your computer and use it in GitHub Desktop.
Get URL parameter with JavaScript
function get_url_parameter(name) {
return decodeURI(
(new 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