4
I am making a status change in my database using $.getJSON
, is working, but in return I need to update the div
where the data is and I am not able to perform this task, see the code below:
<script>
$(function(){
$("[name='btncapa']").on('click',function(e){
var IdProduto = $(this).attr('IdProduto');
var IdProdutoFoto = $(this).attr('IdProdutoFoto');
var $el = $(this);
bootbox.dialog({
message: "Confirma a marcação de capa?",
title: "Capa",
buttons: {
success: {
label: "Sim",
className: "btn-success",
callback: function() {
$.getJSON('MarcaItemFoto.php', {IdProduto: IdProduto, IdProdutoFoto: IdProdutoFoto}, function(resposta){
$("#diverro").html("<div class='alert alert-error'><button type='button' class='close' data-dismiss='alert'>×</button><strong>ERRO!</strong> " + resposta.erro + "</div>");
});
$el.parents('li').load();
}
},
danger: {
label: "Não",
className: "btn-danger",
callback: function() {
}
}
}
});
e.preventDefault();
});
});
</script>
.load(URL)
has a mandatory parameter, a URL that will return this listli
,$.getJSON(URL, json, functionSucess)
from what I understand, you want to upload the listli
after doing 'Marcaitemfoto.php'? 'Marcaitemfoto.php' returns what?– Leandro Amorim
Hello bigown, good night, it returns me the status of the operation, being true/false ai handle the message if it is an error, otherwise I would like to update the list.
– adventistapr