Here is my JS code:
for (var i in loadFile) {
var count = 1;
if(i != 0){
$.ajax({
'global': 'false',
'type': "GET",
'dataType': 'json',
'data': {
0: loadFile[i][0],
1: loadFile[i][1],
2: loadFile[i][2]
},
'url': "<?php echo base_url();?>/config/export_import_taches/get_check_statut_tache.php",
'success': function (data) {
var rowStatus = data;
dataTable2.row.add(
[
rowStatus,
loadFile[count][0],
loadFile[count][1],
loadFile[count][2]
]
).draw();
count = count + 1;
}
});
$('#div_table_loadfile').show();
}
}
I would like to be able to "stop" the program until the Ajax call is completed. Because my script automatically goes to the next record even without the response and this is causing me problems... Thanks in advance.