Вновь у меня проблема с ajax. Вот код:
Код: Выделить всё
$('.to-cart').on('click', function(e){
e.preventDefault();
var id = $(this).data('id');
var qty = $('#qty').val();
//var sise = $('#sise').val();
$.ajax({
url: 'index.php?r=cart/add',
data: {id: id, qty: qty},
type: 'GET',
success: function(res){
if(res === '') alert('Ошибка!');
showCart(res);
},
error: function(){
alert('Error');
}
});
});