Skip to content

Instantly share code, notes, and snippets.

@pbakondy
Last active September 3, 2015 16:22
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 pbakondy/15ac53c3a45026d844c4 to your computer and use it in GitHub Desktop.
Save pbakondy/15ac53c3a45026d844c4 to your computer and use it in GitHub Desktop.
Return document URL GET parameter value by name
function getURLParamValue(name) {
var v;
document.location.search.substring(1).split('&').forEach(function(value) {
if (value.split('=')[0] === name) {
v = value.split('=')[1];
}
});
return v;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment