JSON (inside array from api):
[{"id":"001", "name":"john", "age":"40"}, {"id":"002", "name":"jane", "age":"30"}]
Ajax:
$.ajax({
url: 'interface_API.php',
dataType: 'json',
success: function(data)
{
for(var i in data){
var row = data[i];
var id = row[0];
var name = row[1];
var age = row[2];
$('#output').append("<tr width='50%'><td>"+id+"</td><td>"+name+"</td><td>"+age+"</td></tr>");
}
}
});
The API uses this to construct:
if(mysqli_num_rows($output)){
while($row = mysqli_fetch_assoc($output)){
$json[] = $row;
}
}
However my Output is 'undefined' repeated for each .append
How do i extract each json object from the array & append to the page?
console.logto see whatdataactually contains?row.idetc. notrow[0].