$(function() {
setInterval(function() {
$.get("refresh.php", function(result) {
$('#response').empty()
.hide()
.html(result)
$("#response").append(result)
.fadeIn("slow");
});
}, 5000);
});
其实我的剧本打refresh.php每5秒在refresh.php我从MySQL数据库提取数据,并创建一个模板:清除DIV内容
<table>
<tr><td>Name<td><td>$fetch['name']</td></tr>
</table>
我在我的萤火虫刷新检查。 PHP5秒后发送响应只有一次,但在所有的浏览器就显示了类似的结果两次:
<table>
<tr><td>Name<td><td>$fetch['name']</td></tr>
</table>
<table>
<tr><td>Name<td><td>$fetch['name']</td></tr>
</table>
感谢哎呀哥们 – 2012-04-05 21:49:14