简体   繁体   中英

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. 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? (due to other requests from your page)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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