//调用
document.getElementById("code").innerHTML=getUrlParameter("code")
// 根据参数名称获取value
function getUrlParameter(paramKey) {
var sURLVariables, i, sParameterName, sPageURL = window.location.search.substring(1);
if (sPageURL) {
sURLVariables = sPageURL.split("&");
for (i = 0; i < sURLVariables.length; i++) {
sParameterName = sURLVariables[i].split("=");
if (sParameterName[0] == paramKey) {
return sParameterName[1]
}
return "notfind"
}
}
}
JS获取URL地址参数代码
最新推荐文章于 2021-06-24 10:13:32 发布