I'm trying to delete records without having to refresh the page, however I'm not having success, the records erase but the table only updates if I give an F5, I'm trying to do this via ajax but it's not rolling, can someone give me a light ? Here I have delete the record button and step the id
<li>
<a onclick="excluirLancamento(<?= $user->id ?>)"><i class="fa fa-trash" aria-hidden="true"></i> Excluir</a>
And here is javascript
<script type="text/javascript">
function excluirLancamento(id) {
if (confirm('Tem certeza que deseja excluir este registro?')) {
$.ajax({async:true, type:'post',
complete:function(request, json) {
$('#caixa').html(request.responseText);
excluirTr('registro'+id);
},
url:'/users/delete/'+id
});
} else { return false; }
}
remembering that I'm importing jquery correctly
<script src="/webroot/js/jquery-3.2.1.min.js"></script>