setIntervel() を使用する関数があり、この関数の実行を明示的に停止したいのですが、どうすればよいですか???関数は..
function autoLoad(chatboxtitle, msgId) {
setInterval(function() {
if (msgId != '') {
$.ajax({
type: "POST",
url: "../WebService1.asmx/GetMessagesDetail",
data: '{ "messageID": "' + msgId + '" }',
contentType: "application/json; charset=utf-8",
dataType: "json",
async: true,
cache: false,
success: function(msg) {
$("#chatbox_" + chatboxtitle + ".chatboxcontent").empty();
$("#chatbox_" + chatboxtitle + ".chatboxcontent").append(msg.d);
$contentLoadTriggered = false;
},
error: function(x, e) {
alert("error");
}
});
}
}, 8000);
}