Skip to content

Instantly share code, notes, and snippets.

@davidlonjon
Created August 21, 2013 08:58
Show Gist options
  • Save davidlonjon/6292014 to your computer and use it in GitHub Desktop.
Save davidlonjon/6292014 to your computer and use it in GitHub Desktop.
JavaScript: Get URL Parameter
// Taken from:
// http://stackoverflow.com/questions/1403888/get-url-parameter-with-jquery
getURLParameter = function(paramName) {
return decodeURIComponent((new RegExp('[?|&]' + paramName + '=' + '([^&;]+?)(&|#|;|$)').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