var num = $val_ids.length;
var i = -;
function ajax(){
i++;
if(i >= num){
return ;
}
console.log('開始:'+i);
video_id = $val_ids[i];
$.ajax({
url: "{:url('video/encryptVideo')}",
type: "get",
async: true,
data: {
video_id: video_id
},
dataType: "json",
beforeSend: function() {
console.log('beforesend'+i);
$("#status_" + video_id).html('生成中');
},
success: function(data) {
console.log("success"+i);
console.log(data);
$("#status_" + data.video_id).html(data.msg);
// 回調ajax
ajax();
},
error: function(data) {
var id = this.url.split('=')[];
$("#status_" + id).html('ajax失敗');
}
});
}
ajax();