I need to execute the function below, after the AJAX request it has to remove the table row, if I put the code that removes the direct line in the function it removes the line normally, but if I put inside the AJAX success it does not remove the line and runs alert
normally at the end.
$('#tabelaMaterial').on('click', '.icon-remove', function (event) {
$.ajax({
url: "/RCM/RemoveItemCarrinho",
type: "POST",
success: function () {
$(this).closest('tr').remove();
alert("Material removido!");
}
})
})