単純なプログレスバーを設定しようとしていますが、「更新」が実行されますが、「すべての」ajaxリクエストが終了した場合のみですか?
リクエストの開始;
$(".cb-download").colorbox({
opacity:.8,
onComplete:function() {
$.colorbox.resize();
if (ERROR !== true) {
// update Progress
var progress = setInterval(updateProgress, 100);
$.ajax({
url: baseUrl + "/mail/do-download",
async: true,
success: function(data) {
$("#mail-download").html(data);
$.colorbox.resize();
clearInterval(progress);
}
});
} else {
$('#mail-download-success').hide();
$('#mail-download-session-lost').show();
$.colorbox.resize();
}
}
});
function updateProgress()
{
$.ajax({
url: baseUrl + "/mail/get-progress",
success: function(data) {
console.log(data);
$("#current-count").html(data);
}
});
}
updateProgessは、数値をエコーするアクションを呼び出しているだけです。
何か案は?