-
-
Save JenieX/69f17be2265969de9754c44fb757e62e to your computer and use it in GitHub Desktop.
Return document URL GET parameter value by name
This file contains hidden or 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