http://gtgdaily.com/site/promo.html адрес сайта, вкладка торнамент
выдает ошибку
Код: Выделить всё
SyntaxError: JSON.parse: unterminated string at line 1 column 81841 of the JSON data
сам ajax
Код: Выделить всё
$('.show_cat').click(function(){
$('.category').removeClass('active');
$(this).parent().addClass('active');
$('#promo').html('');
$('#promo').addClass('promoload');
$.ajax({
type:'POST',
url:'/site/AjaxPromo',
data:'cat_id='+$(this).attr('data-id'),
dataType:'json',
timeout: 10000,
success:function(data){
$('#promo').removeClass('promoload');
// console.log(data);
$('#promo').html(data.html);
},
error: function(xhr, ajaxOptions, thrownError){
alert(xhr.status);
alert(thrownError);
}
});
});
Код: Выделить всё
/* Функция получения промо материалов по ajax */
public function actionAjaxPromo()
{
$params = $_POST['cat_id'];
$model=Rooms::model()->findAll(array('order'=>'sort'));
$html=$this->renderPartial('ajax/_promo',array('model'=>$model,'category'=>$params),true);
echo CJSON::encode(array('html'=>$html));
}