jQuery tablesorter从错误的页面开始

我使用tablesorter ( http://tablesorter.com/docs/ )与它的AJAX呼叫器function。 这里是我用来初始化插件的代码:

 $(".track-grid table.tablesorter") .tablesorter({ widthFixed: false, cssChildRow: 'infoRow', widgets: ['zebra'] }) .tablesorterPager({ container: $(".pager"), ajaxUrl : 'analyse/getEvents?page={page}&size=10&totalCount='+totalCount, customAjaxUrl: function(table, url) { // get current selection & add it to the url return url += '&filter=' + JSON.stringify(filter); }, ajaxProcessing: function(data){ $('#tablesorter tbody').html(data.result.eventsHtml); return [ parseInt(data.result.totalEventsCount) ]; }, page: 0, processAjaxOnInit: true, output: '{startRow} to {endRow} ({totalRows})', updateArrows: true, fixedHeight: false, removeRows: false, cssNext : '.next', // next page arrow cssPrev : '.prev', // previous page arrow cssFirst : '.first', // go to first page arrow cssLast : '.last', // go to last page arrow cssGoto : '.gotoPage', // page select dropdown - select dropdown that set the "page" option cssPageDisplay : '.pagedisplay', // location of where the "output" is displayed cssPageSize : '.pagesize', // page size selector - select dropdown that sets the "size" option cssDisabled : 'disabled', // Note there is no period "." in front of this class name cssErrorRow : 'tablesorter-errorRow' // error information row }); 

这一切运作良好。 事件被初始化(从后端获取),每当我点击改变页面,新的事件被加载。 但是,页面似乎“记住”用户最后一次login到他的帐户。 例如:如果我第一次打开页面,页面1(0)开始,但如果我切换几页,然后重新启动nodeJS服务器,重新启动浏览器和一切,每当我login回应用程序页面仍然是我手动设置的最后一个页面。 如何强制传呼机始终从第一页开始? (在页面刷新以及)页面大小显示为25,但我在初始化设置为10.我在哪里出错了?

先谢谢你!

看来你实际上是使用了tablesorter的fork ,它把ajax的function加到了pager上。

您可以在本文档部分find所有的寻呼机选项 。 你想要做的是将savePages选项设置为false