Answer the question
In order to leave comments, you need to log in
Loop through multidimensional array in ajax loop to display?
Good time of the day.
Tell me how to iterate over a multidimensional array in the ajax loop to display on the screen?
I don't know what I'm doing right, I can't get it to display
success: function(data) {
$.each(data, function(index,value) {
index = index + 1;
id = (value['id']);
owner = (value['owner']);
type_record = (value['type_record']);
pri = (value['pri']);
weight = (value['weight']);
port = (value['port']);
data = (value['data']);
Answer the question
In order to leave comments, you need to log in
success: function(data) {
var rowsHtml = '';
$.each(data, function(index,value) {
rowsHtml += '<tr>';
rowsHtml += ' <td>' + value['id'] + '</td>';
rowsHtml += ' <td>' + value['owner'] + '</td>';
rowsHtml += '</tr>';
}
var html = '<table><thead><tr><td>Id</td><td>Owner</td></tr></thead><tbody>' + rowsHtml + '</tbody></table>';
$(document).append(html);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question