I have a simple Ajax call in jQuery like this...
function my_call(identifier) {
var settings = {
"async": true,
"crossDomain": true,
"url": "http://www.example.com/?" + identifier,
"method": "GET",
"headers": {
"Accept": "application/json",
},
"processData": false,
"contentType": false,
"dataType" : "json",
"mimeType": "multipart/form-data",
}
$.ajax(settings).done(function (response) {
console.log(response);
});
}
And I am calling it 10 times for different identifiers like this...
my_call(1);
my_call(2);
my_call(3);
my_call(4);
my_call(5);
I have set async to true so had assumed these calls would all happening at the same time, but instead I seem to get the results print to the console one after the other with a bit of a delay in between.
Am I doing it correctly, or is there a different way to call the function? I am trying to reduce the time it takes to return the results.