Js:
function onAjaxSuccess(data){ console.log(data); data.forEach(function(data) { table.innerHTML += getRowTemplate(data); } ); } function getRowTemplate(userData) { return '<tr>' + '<td>' + userData.tovar + '</td>' + '<td>' + userData.type + '</td>' + '<td>' + userData.proizvoditel + '</td>' + '<td>' + userData.hvat + '</td>' + '<td>' + userData.ygol + '</td>' + '<td>' + userData.lengthc + '</td>' + '<td>' + userData.color + '</td>' + '</tr>' } What's wrong?
Content data:

datais a string, and only one of two lines is needed:var results = JSON.parse(data);- Grundyconsole.logoutput, and if there are line breaks in the line - it perfectly displays them - Grundydata, so you can't parse it. The comma islengthcafter the value for thelengthcfield in each element of the array - Grundy