任何地方我有这样的jQuery代码:#fr_tab股利的setInterval的onclick和的点击明确的文件
$('#fr_tab').click(function() {
$("#tab2").empty().html('<img src="images/loading.gif" />');
var handle = setInterval(function() {
$('#tab2').load('fr_quests.php');
}, 3000);
});
$('body').click(function() {
if (handle) {
clearInterval(handle);
handle = 0;
}
});
我在想,当点击#fr_tab时,我如何能够setIneterval,我怎么能在任何地方,如果清除它在文件中被点击。
不清除处理:(。 – re1man
这个代码在$(document).ready?内? – Will
是的......实际上我会在我的当前代码中添加 – re1man