私はXMLHttpRequest
の配列を持っています(正常に動作しています)。 readystatechange関数に関する次の配列を書きました:読み取り機能の配列を行います
xhr[i].open('post', 'PHP/write_and_exec_opt.php');
display_opt[i] = xhr[i].onreadystatechange = function(index) {
if (xhr[index].readyState == 4 && xhr[index].status == 200) {
text = xhr[index].responseText.trim();
n_finished++;
console.log('display_opt', n_finished);
}
xhr[index].send(data);
}(i);
xhr要求は正しく実行されます。コンソールログに出力はありません。何故なの?
[閉鎖ループ](http://stackoverflow.com/q/750486/1048572)を使用しようとしたようですか? [this](http://stackoverflow.com/a/25267864/1048572)を見てください。 – Bergi