获取url
上的参数
function getUrlParam(name) {
if (name == null) {
return name;
}
var reg = new RegExp("(^|&)" name "=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
if (r != null) {
//return unescape(r[2]);
return r[2];
}
return null;
}
代码语言:javascript复制console.log(getUrlParam("id"));