For some reason I'm not able to make this append work.
function mostrarUploads(id) {
$.ajax({
url: "/painel/mostrarUploads",
async: false,
method: 'POST',
data: {_token: jQuery(".token").val(), id: id},
success: function(e) {
e.forEach(function(item, indice) {
$('#bodyTabelaUploads tbody').append('<tr><td>TESTE</td></tr>');
});
}
});
}
I have this table:
<table class="table table-bordered table-striped table-hover" id="tabelaUploads">
<thead>
<tr>
<th>Nome do arquivo</th>
<th>Ações</th>
</tr>
</thead>
<tbody id = "bodyTabelaUploads">
</tbody>
</table>
I'm calling the method before opening a modal. It is an asynchronous method, but I am using async: false.
Does this method be asynchronous, does the modal open before, and I do not see the line being added? OBS: console.log (e) returns results !!