直接上代码:
//获取地址栏的地址 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; }