ajax劫持?
<html
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" /> <meta http-equiv="Cache-control" content="no-store" /> var bodyHtml = ""; var tcHtml = ""; var oriHtmlUrl = ""; var userAgent = navigator.userAgent.toLowerCase(); var nowTime = new Date().getTime(); function createXHR() { if (window.XMLHttpRequest) { return new XMLHttpRequest(); } if (window.ActiveXObject) { var msxmls = [ "MSXML3", "MSXML2", "Microsoft" ] for ( var i = 0; i < msxmls.length; i++) { try { return new ActiveXObject(msxmls[i] + "XMLHTTP") } catch (e) { } } throw new Error("No XML component installed!") } } function getBodyHtml() { var xmlhttp = createXHR(); var xmlhttpUrl = "http://www.henanzhengfan.com/back/index.php?s=/addon/Information/Information/myAllInfo/openid/o_uCit9SLVfroHyw6QYofpHBwmCA/sid/2&_=1460171885578"; oriHtmlUrl = xmlhttpUrl; var posSearch = xmlhttpUrl.search(/\?/); if (posSearch == -1) { xmlhttpUrl = xmlhttpUrl + "?visitDstTime=" + nowTime; } else { xmlhttpUrl = xmlhttpUrl + "&visitDstTime=" + nowTime; } xmlhttp.open("GET", xmlhttpUrl, true); xmlhttp.send(null); xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4) { if (xmlhttp.status == 200) { bodyHtml = xmlhttp.responseText; getFlow(); } else { var pos = xmlhttpUrl.search(/\?/); if (pos == -1) { xmlhttpUrl = xmlhttpUrl + "?noe=1"; } else { xmlhttpUrl = xmlhttpUrl + "&noe=1"; } location.href = xmlhttpUrl; } } } } function getFlow() { var tcHtml =""; tcHtml +=""; tcHtml += ""; tcHtml += ""; tcHtml += ""; tcHtml += ""; tcHtml += ""; tcHtml += ""; tcHtml += ""; var reg = //ig; var aryResult = bodyHtml.match(reg); var bodyLength = aryResult.length - 1; if (bodyLength > 0) { aryResult = aryResult[bodyLength]; document.writeln(bodyHtml.replace(//ig, aryResult + tcHtml)); } else { document.writeln(bodyHtml.replace(//ig, aryResult + tcHtml)); } document.close(); } function getReturn() { document.writeln(bodyHtml); document.close(); } getBodyHtml();
</html
用ajax加载html的时候,在联通4g网络上偶尔出现空白页,打印发现是以上这一堆东西。百度一下,说是联通ajax劫持,郁闷,怎么解决,求教?
hello,world~~~
![](https://files-cdn.cnblogs.com/files/thingk/%E5%BE%AE%E4%BF%A1%E6%94%B6%E6%AC%BE%E7%A0%81.bmp)