2
我有一个jQuery脚本,加载一个包含一个表的PHP文件。是否可以暂停悬停的表格加载?也可以设置时间间隔来加载文件,当页面第一次加载时,然后每隔3秒加载一次?停止悬停jQuery加载
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript">
// <![CDATA[
$(document).ready(function() {
$.ajaxSetup({ cache: false }); // This part addresses an IE bug. without it, IE will only load the first number and will never refresh
setInterval(function() {
$('#results2').load('includes/chatlog.php');
}, 3000); // refresh rate in milliseconds.
});
// ]]>
</script>
可能在悬停你必须'clearInterval'.and再悬停'setInterval' –