This is my code:
for (var i = 0; i < 20; i++) {
$.ajax({
type: "GET",
async: false,
url: "/MyController/MyMethod",
success: function (data) {
if (i == 0) {
$('#result_progress').hide();
$('#result_msg').hide();
$('#details').show();
} else if (i == 1) {
$.ajax({
type: "GET",
async: true,
url: "/Import/Finish",
success: function (data) {
....
});
}
if (i < 2) {
$('#details').html($('#details').html() + 'someText'));
}
}
});
}
I don't want to use async: false because my browser stops working. How would I fix this in another way?