我尝试在同一时间循环几次将POST发送到站点。
但是现在发生的是,它等待直到第一个完成,然后为下一个allsounds
进行POST,然后创建Delay。
代码:
var allsounds = ["sound.wav","adom.wav","alarm.wav","tiny.wav","calm.wav","tiny4.wav","tiny5.wav","tiny4.wav",""];
for (var i = 0; i < allsounds.length; i++) {
$.post("alerts.php", {zone: zone, list: allsounds[i]});
$.post("alerts1.php", {zone: zone, list: allsounds[i]});
$.post("alerts2.php", {zone: zone, list: allsounds[i]});
}