利用"XXXX.htm"和"XXX.php"两个文件来实现数据的刷新 XXXX.htm <head> <script> calrs(); function reload_me() calrs(); // Refresh code <script id="reload1"></script> </head><small> </small> XXXXX.php <?php
// Refresh code
r_s = 0;
timenow = 0;
function calrs()
{
d = new Date();
h= d.getHours(); m = d.getMinutes(); s = d.getSeconds();
if( m < 10) m = '0' + m;
if( s < 10) s = '0' + s;
status = ' ' + h + ":" + m + ":" + s;
r_s = 2000;
}
{
c = document.getElementById("reload1");
c.src = "";
c.src = "XXXXX.php?reload=1";
setTimeout('reload_me()', r_s);
}
setTimeout('reload_me()', r_s);
</script>
<div id="p_show></div>
header("Cache-Control: no-cache, must-revalidate");
echo "document.all.p_show.innerHTML= \"?<font color=red>".rand(0,9)."</font>\"";
?>
文章来源于领测软件测试网 https://www.ltesting.net/
版权所有(C) 2003-2010 TestAge(领测软件测试网)|领测国际科技(北京)有限公司|软件测试工程师培训网 All Rights Reserved
北京市海淀区中关村南大街9号北京理工科技大厦1402室 京ICP备10010545号-5
技术支持和业务联系:info@testage.com.cn 电话:010-51297073