getQueryString //快速获取浏览器地址参数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;}//示
//快速获取浏览器地址参数 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; } //示例:拓展页面跳转 function jumpToUrl(url, _blank) { var bd_channel = getQueryString("bdcid"); if (bd_channel) { var tx_adtag = getQueryString("ADTAG"); tx_adtag = tx_adtag ? "&ADTAG=" + tx_adtag : ""; if (_blank) { window.open(url + "?bdcid=" + bd_channel + tx_adtag); } else { window.location.href = url + "?bdcid=" + bd_channel + tx_adtag; } } else { if (_blank) { window.open(url); } else { window.location.href = url; } } }