// Added dollar sign to question
$(".purchase_btn").live("click",function(){
//renew cart
$.ajax({
url: "<?=base_url()?>frontend/ncart/smallcart/",
type: "post",
async: false,
dataType: "json",
success: function(data){
$("#cart_div_item").html(data.cart);
$("#cart_div_total").html("總計:$"+data.total);
}
});
$("#cart_div_small").show();
$('#cart_div_small').aqFloater({
attach: "e",
offsetY: -150,
overlay: 10,
overlayOpacity: 0.7
});
clog("cart reinit");
});
How to use $.ajax in live? the $.ajax is not working when I use live
If type change to get it can work, but I want to use post to get json data.
Any idea?
make your self an error function to catch errors: