1.模板底部加上一下代码
<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'])); }