Ajax request are not async

后端 未结 4 996
既然无缘
既然无缘 2021-01-06 09:48

I have an ajax problem:

foreach(ids as id){
  $.ajax({
    url:\'script.php\',
    data:\'id=\'+id,
    cache:false,
  });
}

If I loop 6 ti

4条回答
  •  Happy的楠姐
    2021-01-06 10:39

    Have you tried with setting the async parameter to true?

    foreach(ids as id)
    {
      $.ajax({
      url:'script.php',
      async: true,
      data:'id='+id,
      cache:false,
      });
    }
    

    How have you confirmed that the calls are synchronous and not async?

提交回复
热议问题