ecshop中can't parse to JSON这个错误怎么解决
方法一:
模板底部加上一下代码
<script type="text/javascript" language="JavaScript">
listTable.recordCount = {$record_count};
listTable.pageCount = {$page_count};
{foreach from=$filter item=item key=key}
listTable.filter.{$key} = '{$item}';
{/foreach}
</script>
2.php页面加上如下代码
/*------------------------------------------------------ */
//-- 排序、分页、查询
/*------------------------------------------------------ */
elseif ($_REQUEST['act'] == 'query')
{
$ads_list = get_adslist();
$smarty->assign('ads_list', $ads_list['ads']);
$smarty->assign('filter', $ads_list['filter']);
$smarty->assign('record_count', $ads_list['record_count']);
$smarty->assign('page_count', $ads_list['page_count']);
$sort_flag = sort_flag($ads_list['filter']);
$smarty->assign($sort_flag['tag'], $sort_flag['img']);
make_json_result($smarty->fetch('ads_list.htm'), '',
array('filter' => $ads_list['filter'], 'page_count' => $ads_list['page_count']));
}
方法二:
<!-- 解决jquery和 transport.js的冲突-->
<script type="text/javascript">
$(function() {
window.__Object_toJSONString = Object.prototype.toJSONString;
delete Object.prototype.toJSONString;
});
</script>