I'm working on a report application which grabs data from an aspx I made. In order to show the data, it uses ajax queries against that page. Depending on the parameters passed, the task can take long or short time.
Everything is okay up to that point. Problem is happening with this jquery code:
<script type="text/javascript">
$(document).ready(function () {
$('.preload').preload();
$('.preload').each(function () {
var obj = $(this);
$.ajax({
type: 'GET',
url: 'GetCounter.aspx',
success: function (data) {
obj.replaceWith(data);
},
});
});
});
</script>
The problem is that they are running synchronously, even if I set "async: true" to the ajax call. The first one in the selector runs, then the second one, and so on, even though they're all getting called at the same time because Firebug shows all the GET requests in the network tab.
Any ideas what could be wrong here?
Thanks in advance! - DARKGuy