Skip to content

Instantly share code, notes, and snippets.

@qwersk
Created May 16, 2017 10:45
Show Gist options
  • Select an option

  • Save qwersk/7f07150582fb522c0a2a1a89d00acf3c to your computer and use it in GitHub Desktop.

Select an option

Save qwersk/7f07150582fb522c0a2a1a89d00acf3c to your computer and use it in GitHub Desktop.
GET URL GET JAVASCRIPT JS
function getURLParameter(name) {
return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search) || [null, ''])[1].replace(/\+/g, '%20')) || null;
}
myvar = getURLParameter('myvar');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment