I have the following status with 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 on:
<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 because it should call ajax again and it does not call. Can someone give a boost?