递归请求ajax,想要每次请求后提示信息。 可是这样写只会在方法执行完成后提示,不会在每个ajax请求后提示
应该是渲染问题,用alert就能每次ajax提示,现在想要问下这怎么解决才能让每次请求的提示信息都显示出来
function khf(i,num){
if(i>num){
$('#showinfo').html("<h4 style='color:red;'>制卡成功,本轮共制卡"+overnum+"张</h4>");
return;
}
$.ajax({
url: 'cardMake/make.do',
type: "POST",
data: $('#form').serialize(),
dataType: "json",
async: false,
success: function(data){
$('#showinfo').html("<h4 style='color:red;'>制卡成功,已制卡"+i+"张</h4>");
console.log("新卡的写卡成功:卡号-"+rtkh);
}
})
khf(i+1,num);
}