jquery 再帰関数を実行したい。しかし、私のコードは機能しません。それを修正するために助けが必要です
function inserting(a, b){
a = typeof a !== 'undefined' ? a : 0;
b = typeof b !== 'undefined' ? b : 50;
if(a < 5000){
$.get("http://domain.com/process-query.php?start="+a+"&limit="+b,function(responseTxt,statusTxt,xhr){
if(statusTxt=="success"){
$("body").append(responseTxt);
a = a + b;
inserting(a,b);
}
if(statusTxt=="error")
alert("Error: "+xhr.status+": "+xhr.statusText);
});
}
}
$(document).ready(function(){
inserting(100, 50);
});
ご協力いただきありがとうございます
参考: process-query.php は、パラメーター a および b に基づいてテキストを出力します。