Skip to content

Instantly share code, notes, and snippets.

@N-Porsh
Created November 19, 2013 12:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save N-Porsh/7544681 to your computer and use it in GitHub Desktop.
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