I have created multiple asynchronous request with jquery like this:
$.when(
$.ajax({
url: site_url_city_1,
type: "GET",
data: window.location.search,
dataType: "json",
success: function(data) {
data_1 = data;
}
}),
$.ajax({
url: site_url_city_2,
type: "GET",
data: window.location.search,
dataType: "json",
success: function(data) {
data_2 = data;
}
}),
$.ajax({
url: site_url_city_3,
type: "GET",
data: window.location.search,
dataType: "json",
success: function(data) {
data_3 = data;
}
}),
$.ajax({
url: site_url_city_4,
type: "GET",
data: window.location.search,
dataType: "json",
success: function(data) {
data_4 = data;
}
}),
$.ajax({
url: site_url_city_5,
type: "GET",
data: window.location.search,
dataType: "json",
success: function(data) {
data_5 = data;
}
})
).then(function() {
//other code
});
I expected into the console to view all request start at the same time but isn't right.
This is my net screenshot from firebug and you can see that the last request start only when previous finished. Why? Is there a limit of asynchronous request?
The image is little but you can view the last two request that aren't asynchronous! The first line isn't an asynchronous request but it was into the screenshot
I need to have all request start at the same time