我使用下面的腳本來刷新攝像頭圖像。它每18秒刷新一次,刷新8次後停止刷新。我有一種感覺,它不能正確取消它。因爲過了一段時間,我看到加載標誌出現故障。我的腳本有問題嗎?用jquery asynch刷新圖像
var count = 0;
function CamRefresh() {
count++;
if(count > 8) clearInterval(timeout);
updatecam();
}
var timeout = setInterval(CamRefresh, 18000);
});
function updatecam() {
$('#loading').show('fast');
$('#activecam').attr('src', 'http://weeg.binaer.no/weeg_com/nesjordet.jpg?time='+Date());
$('#loading').hide('slow');
$('#currentswitch').hide(1500);
$('#dayswitch').show();
}
那是什麼額外的'});'for? – Dogbert