I'm getting in json a category list that has the id and name data.
I do the restful in pure javascript and I can already see the data in the browser console, I am using this code:
if (xhr.status == 200) {
window.sessionStorage.setItem('lista', xhr.responseText);
var lista = window.sessionStorage.getItem('lista');
lista = JSON.parse(lista);
let x = document.querySelector('#body')
JSON.map(item => {
x.innerHTML += '<tr><td>'+ item.title +'</td></tr>'
});
}
My problem is that I do not know how to enter the data I receive into the table to display it to users. Can anyone at least tell the logic or show me an example code if it is possible?