AJAX异步不起作用

时间:2017-08-08 12:47:32

标签: javascript ajax

我尝试向我的后端发送16个异步请求。

$.each(response, function( k, v ) {
    uploadAdditionalRows(v)
});

function uploadAdditionalRows(value) {
                $.ajax({
                    url: "/asins/table_data/" + encodeURIComponent(value),
                    cache:false,
                    type: "GET",
                    success: function(response) {
                        console.log(response);
                    }
                });

                return;
            }

但他们会一个接一个地执行。

enter image description here

如何得到这样的回应? :

enter image description here

1 个答案:

答案 0 :(得分:5)

浏览器强制限制它们将打开的同时HTTP连接数(以及对任何给定域的连接数的较小限制)。

如果超过该限制,请求将进入队列。

你可以看到这一点,前四个同时开始,然后其余的都被推迟。

相关问题