Skip to content

Instantly share code, notes, and snippets.

@N-Porsh
Created November 19, 2013 12:33
Show Gist options
  • Select an option

  • Save N-Porsh/7544681 to your computer and use it in GitHub Desktop.

Select an option

Save N-Porsh/7544681 to your computer and use it in GitHub Desktop.
JavaScript: getURLParam
function getURLParameter(name) {
return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search)||[,""])[1].replace(/\+/g, '%20'))||null;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment