function getQueryString(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); var r = window.location.search.substr(1).match(reg); if (r != null) { return unescape(r[2]); } else { return null; } } /* var url = "https://www.tianmaotv.cn"; if (getQueryString("t") != "") { url = getQueryString("t"); }*/ var url = window.location.href; if (url.indexOf('?t=') > 0) { url = url.split('?t=')[1]; } //alert(url); window.location.href = url;