用JS获取地址栏参数
作者:互联网
直接上代码:
//获取地址栏的地址 function GetQueryString(name) { var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); var r = window.location.search.substr(1).match(reg); if(r!=null)return unescape(r[2]); return null; } //是否存在isReceive参数,存在isReceive_type为1,否则为0 let isReceive_type = 0; let myurl = GetQueryString("isReceive"); if(myurl !=null && myurl.toString().length>1) { isReceive_type = 1; } else { isReceive_type = 0; }
参考网址:https://www.cnblogs.com/webenh/p/6431700.html
标签:GetQueryString,地址栏,JS,参数,myurl,null,type,isReceive 来源: https://www.cnblogs.com/zzz-knight/p/12955605.html