below is the code i use to show data on page , html is dynamically created , other method is that i query databse and use res.render method to render it , which should be use?
if (tBody) {
return (
`<tr class="tr1">
<th class="th1"> Category Name </th>
<th class="th1">Delete </th>
</tr>` +
getdata.data
.map(function (wizard) {
return `<tr class="td1"> <td class="th1"> ${wizard.categoryName}</td>
<td class="td1"><a class="delClass" onclick="removeCat(this)" data-remove="${wizard._id}">Delete</a></td>
</tr>`;
})
.join('')
);
Aucun commentaire:
Enregistrer un commentaire