我想停止error
处理程序中的此间隔重复运行。那有可能吗?
// example code
$(document).on('ready',function(){
setInterval(updateDiv,3000);
});
function updateDiv(){
$.ajax({
url: 'getContent.php',
success: function(data){
$('.square').html(data);
},
error: function(){
$.playSound('oneday.wav');
$('.square').html('<span style="color:red">Connection problems</span>');
// I want to stop it here
}
});
}
2
JavaScript
—
Mohammad