使用JS获取地址栏的参数
2021-02-16 22:19
标签:bsp cti nes ring query location window name reg function GetQueryString(name) { 使用JS获取地址栏的参数 标签:bsp cti nes ring query location window name reg 原文地址:https://www.cnblogs.com/MNCnblogs/p/12965507.html
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
if (r != null) return unescape(r[2]); return null;
}
console.log((GetQueryString("BSUserId")));
var BSID = GetQueryString("BSUserId");