简体   繁体   English

jQuery Ajax响应不是异步的

[英]jQuery Ajax response are not asynchronous

I have two Ajax calls in my MVC code, for both I have set async: true , but however after first request is made and if I try to make 2nd Ajax request, the 2nd is waiting first to get response, only after getting first Ajax response, 2nd request's result is appended. 我在MVC代码中有两个Ajax调用,因为两者都设置了async: true ,但是在发出第一个请求后,如果我尝试发出第二个Ajax请求,则第二个将首先等待获得响应,只有在获得第一个Ajax之后响应,将附加第二个请求的结果。 I am not finding solution for this. 我没有找到解决方案。

Code is as below: 代码如下:

First call: 首次致电:

var page_request = $j.ajax({
    url:pageurl+'?rel=tab',
    async:true,
    dataType:"html",beforeSend: function () {
        middlePanel.html('Loading...');
    },
    success: function(data){
        middlePanel.html(data);                     
        fitBoundsWithoutSeco();                        
    },
    error: function (xhr, textStatus, errorThrown) {
        middlePanel.html(textStatus);
    }
});

The second is same as first. 第二个与第一个相同。

simultaneous requests in web browsers are limited to 6. any chance you are hitting this limit after your first ajax call? Web浏览器中的并发请求限制为6.在首次ajax调用之后,您是否有可能达到此限制? (due to other requests from your page) (由于您页面中的其他请求)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM