0
I have the following matching ajax call:
$(document).ready(function() {
$(".atualizarAjax").click(function(){
var id = $(this).attr("data-id");
$.ajax({
type: 'GET',
url: "<?= HOME ?>/ajax_carrinho.php",
data : "id="+id,
beforeSend: function(){
$(".carregando").show();
$(".carregando").html("<img src='<?= HOME ?>/img/ajax-loader.gif' style='width: 20px; height: 20px;'> Adicionando...");
},
success: function (data) {
$('.carrinhoGO').html(data);
$('.recarrega').load("<?= HOME ?>/ajax_produtos.php?id="+id);
$(".carregando").hide();
}
});
return false;
});
});
<!-- begin snippet: js hide: false console: true babel: false -->
<a href="#" id="atualizarAjax" data-id="<?= $value['id']?>" class="btn btn-info btn-xs atualizarAjax"><i class="fa fa-plus"></i> Comprar</a>
The problem is that in the file that loads on this line:
$('.recarrega').load("<?= HOME ?>/ajax_produtos.php?id="+id);
Contains a link to be clicked:
<a href="#" id="atualizarAjax" data-id="<?= $value['id']?>" class="btn btn-info btn-xs atualizarAjax"><i class="fa fa-plus"></i> Comprar</a>
This link does not work as it should call ajax again and does not call. Someone can lend a hand?