私は Ajax の完全な初心者なので、これが完全にばかげたコードである場合はご容赦ください。
for (var i=0; i<11; i++) {
jQuery('#position').html(i);
var offset = jQuery('#offset').html();
var postcall = 'controller.php?url='+encodeURIComponent(scrapurl)+'&scrape_absolute='+absoluteep+'&scrape_season='+season+'&scrape_show='+showslug+'&scrape_defimg='+encodeURIComponent(defaultimg)+'&offset='+offset;
jQuery.post(postcall,function(data){
jQuery('#offset').html(data);
});
}
ここでの目標は、指定された値で controller.php を実行し、返された情報を使用して各呼び出しに「オフセット」をプラグインすることです。動作しますが、0 から 10 まで瞬時に実行され、Web サーバーは後続の呼び出しを拒否します。
私の目標は、最後の操作が完了するまでphpを再度呼び出さないようにすることです。