更多技术问题解决案例请访问:IT摆渡网 -- 一个IT实时在线问答平台,解决任何IT技术难题,无需等待,立马解决!--www.itbaiduwang.com
<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="/jquery-1.5.1.js"></script>
<style type="text/css">
button.b1{background-color: #39b3d7;}
button.b2{background-color: red;}
</style>
<script>
$(function(){
$("#sxa").click(function(){
$("#cs").load('/ceshi2.php');
});
});
function funcTest(){
//每隔3秒执行一次timelyFun方法
window.setInterval("timelyFun()",1000);
}
function timelyFun()
{
$("#cs").load('/ceshi2.php');
}
window.onload = funcTest();
</script>
</head>
<body>
<div class="container">
<span>A刷新次数:</span>
<div id="cs"><?php include("ceshi2.php");?></div>
</div>
<button id="sxa">点击刷新A</button>
<div class="container1">
<span>B刷新次数:</span>
<div id="cs1"><?php include("ceshi1.php");?></div>
</div>
<button id="sxb">点击刷新B</button>
</body>
</html>