当前:url=www.baidu.com?id=2
id = GetQueryString(id)//2
function GetQueryString(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
var r = window.location.search.substr(2).match(reg);
if(r != null) return unescape(r[3]);
return null;
}
原文地址:https://www.cnblogs.com/qijiamin/p/9494882.html
时间: 2024-10-08 13:53:56