标签:ram 链接 win geturl fun mat regexp return escape
获取网页链接中的参数
function getUrlParam(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
if (r != null) return unescape(r[2]); return null;
}
getUrlParam(‘id‘)
标签:ram 链接 win geturl fun mat regexp return escape
原文地址:https://www.cnblogs.com/xiaoyaolang/p/14651507.html