i have a web page with more div's. Each div load via ajax one action that calculate and show the report data in html.
Code html:
<div class="divAutoLoading" data-href="/controller/action"></div>
Code js:
$('.divAutoLoading').each(function () {
var divAutoLoading = $(this);
divAutoLoading.showLoading();
$.ajax({
type: 'POST',
url: divAutoLoading.attr('data-href'),
async: true,
cache: false,
success: function (html) {
divAutoLoading.hideLoading();
divAutoLoading.html(html);
}
});
});
Then I have 4 divs, they call four different action, every action has different computation times. What I expect is that when an Action ends, showing the results, but instead it seems as if the action is put in the queue, and if it is not completed the previous one, does not start the next one. What am I doing wrong?
P.S. jquery version is: 1.8.2