Skip to content

Instantly share code, notes, and snippets.

@BuddyLReno
Last active August 29, 2015 14:21
Show Gist options
  • Save BuddyLReno/bb6b83812f4fc78fb4eb to your computer and use it in GitHub Desktop.
Save BuddyLReno/bb6b83812f4fc78fb4eb to your computer and use it in GitHub Desktop.
Finds query string parameters and returns them.
function getUrlParameter(parameterName) {
var results = new RegExp('[\?&]' + parameterName + '=([^&#]*)').exec(window.location.search);
if (results === null) {
return "";
} else {
return results[1] || "";
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment