I am trying to execute this code:
var table = document.getElementById("tab");
for (var i = 0, row; row = table.rows[i]; i++) {
//rows would be accessed using the "row" variable assigned in the for loop
let idd = row.cells[1].textContent;
if(idd != 'Id' && idd != '') {
$.ajax({
type: "POST",
url: "/numordiniperiodoagenti",
data: {id : idd, start: sstart, end: eend},
success: function(response){
row.cells[10].textcontent = 'p'; //or response as it should be
}
});
}
}
But it seems that row
is inaccessible inside this ajax
call.
What am I missing here?