반응형
function get_param(str)
{
var res = "", tmp = "";
var params = location.search.substr(location.search.indexOf("?") + 1);
params = params.split("&");
for(var i = 0; i < params.length; i++)
{
tmp = params[i].split("=");
if(tmp[0] == str) {res = tmp[1];}
}
return res;
}
console.log(get_param("변수명"));
반응형