I use the ajax code to make a post and update a record inside the database. After that I wanted to load the page again without reloading the page. Refers to a product delivery screen. When I click on the delivery button a label with the situation of the product shows the text "Open" and after I click it it should show "Delivered". The update process in the database works. So I would just like to change this text of the situation without refresh. Can you do that?
Ajax code:
$(".tabela-detalhes").on("click","#botao-entrega-volume",realizaEntrega);
function realizaEntrega() {
event.preventDefault();
var compra = $(this).parent().parent().find("#compra").val();
var sequencia = $(this).parent().parent().find("#sequencia").val();
var volume = $(this).parent().parent().find("#volume").val();
var dados = {
compra:compra,
sequencia:sequencia,
volume:volume
};
$(".entrega-volume").attr("name","entrega-volume").attr("value",JSON.stringify(dados));
$.post("controle/compras-volume-entrega.php",dados);
}