0
프로토 타입 ajax 및 setTimeout에 문제가 있습니다. 여기 내 코드는 단축 :프로토 타입 ajax, 두 번째 setTimeout 이후에 정의되지 않은 json
//new ajax request
....onComplete: function (transport) { //json as this -> array[$i].something
var json = transport.responseJSON;
var $i = 0;
window.setTimeout(function() {
SLOW();
},
500); //display every json[$i] with custom delay
function SLOW() {
$i++;
if (json[$i].something !== null) { //insert in proper div id in the html document
window.setTimeout(function() {
$('document_div' + json[$i].something).innerHTML = json[$i].something_to_display;
},
500);
window.setTimeout(function() {
$('document_div' + json[$i].something).innerHTML = json[$i].something_to_display;
},
1000);...window.setTimeout(function() {
SLOW();
},
500);
} else {
//stop and continue
}
이 오류를 얻기 : json[$i]
는 정의되지 않습니다.
EDIT : 두 번째 시간 초과시이 오류가 발생하는 것처럼 보입니다. 첫 번째 오류는 div를 올바르게 변경합니다.