編輯: 顯然,他們添加此免費託管頁面,以防止濫用。但我通過添加「退出」來擺脫它。最後。 ENDofEDIT來自服務器與AJAX的奇怪迴應
我做了一個叫做ajax的函數,所以我不必在任何需要的地方編寫代碼,而且效果很好。 但現在作爲迴應,我總是得到我預期的那樣響應數據加上這樣的:
<!-- Start of StatCounter Code for Default Guide -->
<script type="text/javascript">
var sc_project=6961715;
var sc_invisible=1;
var sc_security="1ca8e3ee";
</script>
<script type="text/javascript"
src="http://www.statcounter.com/counter/counter.js"></script>
<noscript><div class="statcounter"><a title="tumblr stats"
href="http://statcounter.com/tumblr/" target="_blank"><img
class="statcounter"
src="http://c.statcounter.com/6961715/0/1ca8e3ee/1/"
alt="tumblr stats"></a></div></noscript>
<!-- End of StatCounter Code for Default Guide -->
我檢查數據與IF(xmlhttp.readyState == 4 & & xmlhttp.status == 200){警報( xmlhttp.responseText);}
我敢肯定,代碼是好的,因爲它是我以前使用的相同的代碼。這裏是:
function ajax(adress, thenDo)
{
var xmlhttp;
if (window.XMLHttpRequest)
{
xmlhttp = new XMLHttpRequest();
}
else {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange = function()
{
if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
{
thenDo(xmlhttp.responseText);
}
}
xmlhttp.open("GET",adress,true);
xmlhttp.send();
}
有誰知道如何擺脫這個?
而我只是檢查它是在該服務器上的每個頁面的底部。 (我使用免費託管在小時代託管)
如果你以前從未見過StatCounter的東西,你可能想確保你的共享主機提供商沒有把它放在那裏。 – castis
以及我新注意到它之前,因爲我更新看在瀏覽器中的源代碼或在該託管網站上使用Ajax,但我不認爲它應該在那裏。但我想我找到了支持票的地方。 有沒有人播過這樣的東西? – zoran404
將'exit;'添加到您的ajax頁面以嘗試緩解它。可能不會幫助,但仍然 – castis