JS的实时函数怎么弄? 确切的说,就是想在一个页面中每隔1分钟到另一个页面中获取某个变量。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 setTimeout调用ajax方法试试 不知行不行 用包含页面,在被包含的页面中再用setTimeout <script type="text/javascript"> function showOnline() { var myXmlHttpRequest = false; try { myXmlHttpRequest=new XMLHttpRequest; } catch(e) { try { myXmlHttpRequest=new ActiveXObject("MSXML2.XMLHTTP"); } catch(e2) { try { myXmlHttpRequest=new ActiveXObject("Microsoft.XMLHTTP"); } catch(e3) {} } } if (!myXmlHttpRequest) return false; myXmlHttpRequest.open ("GET", "http://flow.netfairy.org:8681/FlowCountAPI/get_people_count.php", true); myXmlHttpRequest.onreadystatechange=function() { if(myXmlHttpRequest.readyState==4) { if(myXmlHttpRequest.status==200) { var online=myXmlHttpRequest.responseText; //alert(online); document.getElementById("online").innerHTML="在线人数:"+online; } } } myXmlHttpRequest.send(null);}//showOnline(); setTimeout("showOnline()",6000) </script> 请问一个Jquery autocomplete自动提示插件的问题 textarea不换行问题 这段在线调试网页的js代码错在哪里? 求高人解决问题 高分 Ajax xml 请问一个关于下拉菜单的问题 如何判断对象是否存在? 急问,A窗口和B窗口都可以打开C窗口,如何使C窗口关闭的时候,返回到打开它的窗口?? 100分的简单问题, 如何点击一个图片实现清空功能? jqery简单小问题 用js过滤特殊符号转为json格式不成功,求解? 新手求解~~速度~~正则表达式哪错了
function showOnline()
{
var myXmlHttpRequest = false;
try
{
myXmlHttpRequest=new XMLHttpRequest;
}
catch(e)
{
try
{
myXmlHttpRequest=new ActiveXObject("MSXML2.XMLHTTP");
}
catch(e2)
{
try { myXmlHttpRequest=new ActiveXObject("Microsoft.XMLHTTP"); }
catch(e3) {}
}
}
if (!myXmlHttpRequest) return false;
myXmlHttpRequest.open ("GET", "http://flow.netfairy.org:8681/FlowCountAPI/get_people_count.php", true);
myXmlHttpRequest.onreadystatechange=function()
{
if(myXmlHttpRequest.readyState==4)
{
if(myXmlHttpRequest.status==200)
{
var online=myXmlHttpRequest.responseText;
//alert(online);
document.getElementById("online").innerHTML="在线人数:"+online;
}
}
}
myXmlHttpRequest.send(null);
}
//showOnline();
setTimeout("showOnline()",6000)
</script>