私はうまく動作するコードの次の部分がありますが、私は特定の条件が満たされたときに自動リフレッシュを停止したいと思います。特定の条件が満たされた後、AJAXコールでタイムアウト機能を停止する方法はありますか?
enter code here
$(document).ready(function() {
setTimeout(function(){ $.ajax({
url: '/jrt/?Id=$data.jacket.id',
method: "GET",
cache: false,
success: function(data) {
//$("#gt").append(data);
$('#gt').html(data);
},
error: function(jqXHR, textStatus, errorThrown) {
alert('error ' + textStatus + " " + errorThrown);
}
})
},10000);
});
の可能性のある重複(http://stackoverflow.com/questions/8443151/how-to-stop-a-settimeout-loop) –
のhttp:// WWW。 w3schools.com/jsref/met_win_clearinterval.asp – Nagaraju