Skip to content

Instantly share code, notes, and snippets.

@codexico
Created April 4, 2013 15:59
Show Gist options
  • Save codexico/5311667 to your computer and use it in GitHub Desktop.
Save codexico/5311667 to your computer and use it in GitHub Desktop.
getUrlParameter javascript
var getURLParameter = function (name) {
return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search)||[undefined,""])[1].replace(/\+/g, '%20'))||null;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment