-
-
Save aadityajs/6546853 to your computer and use it in GitHub Desktop.
JS to grab Get Paramert from URL
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
var getparams = function(param) { | |
var url = window.location.search.substring(1); | |
var urlvars = url.split('&'); | |
for (var i = 0; i < urlvars.length; i++) { | |
var paramname = urlvars[i].split('='); | |
if ( paramname[0] == param) { | |
return paramname[1]; | |
} | |
} | |
}; | |
var param1 = getparams('param1'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment