freebsder 发表于 2015-7-22 12:25
__SL_P_UTP 吧?记得G是说get,P是说post
如果改成get的话,像这样 :
var paramTEMP = "__SL_G_UTP" ;
//testcount = testcount +1 ;
HTTPrequest.open("GET","__SL_G_UTP", true);
document.getElementById('txt').value=20 ;
HTTPrequest.onreadystatechange = function()
{
if (HTTPrequest.readyState==4 && HTTPrequest.status==200)
{
var temperature = HTTPrequest.responseText;
document.getElementById("TempValue").innerHTML = temperature;
document.getElementById('txt').value=100 ;
}
}
HTTPrequest.send();
setTimeout("periodicUpdate()", 1000);
我刚试了一下这个代码,结果不仅温度显示不出来,连灯都不亮了。。。。。。