Last active
September 3, 2015 16:22
-
-
Save pbakondy/15ac53c3a45026d844c4 to your computer and use it in GitHub Desktop.
Return document URL GET parameter value by name
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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