I have two consecutive Async Ajax calls as below, when I execute that, I am expecting '1st complete' will be print if it takes less time than call2 (id=2) vice-versa '2nd complete' will be print if it takes less time than call1 (id=1). But, I observe that second call always wait for first call to complete. get confuse with Async. please help.
$(function(){
jQuery.ajax({
url: 'Home/getItem',
data : { id : 1 },
async:true,
success: function(){ console.log('1st complete'); }
}),
jQuery.ajax({
url: 'Home/getItem',
data : { id : 2 },
async:true,
success: function(){ console.log('2nd complete'); }
})
});
When I check same functions with core php, it return expected results.