Ajax无限滚动和分页错误

Ajax infinity scroll and pageination error

我在使用 ajax 无限滚动时遇到问题,浏览器中的后退按钮 return 将我转到页面的上一个加载部分。我怎样才能return回到上一页?

$(document).ready(function() {
    // Infinite Ajax Scroll configuration
    jQuery.ias({
        container : '.wrap', // main container where data goes to append
        item: '.item', // single items
        pagination: '.nav', // page navigation
        next: '.nav a', // next page selector
        loader: '<img src="css/ajax-loader.gif"/>', // loading gif
        triggerPageThreshold: 3 // show load more if scroll more than this
    });
});

这是导航:

<?php if (isset($next)): ?>
    <div class="nav">
        <a href='index.php?p=<?php echo $next?>'>Next</a>
    </div>
<?php endif; ?>

现在我应该为此使用 Rewrite,因为它为我的 url 添加了一个新值,还是有其他解决方案?

代码来自此页面:link

如果您使用的是 GitHub version, then just disable paging and history plugins. If you're using the w3bees 版本,那么在默认列表中,您会注意到 历史记录 条目:

e.ias.defaults = {
        container: "#container",
        scrollContainer: e(window),
        item: ".item",
        pagination: "#pagination",
        next: ".next",
        noneleft: !1,
        loader: '<img src="images/loader.gif"/>',
        loaderDelay: 600,
        triggerPageThreshold: 3,
        trigger: "Load more items",
        thresholdMargin: 0,
        history: !0,
        onPageChange: function() {},
        beforePageChange: function() {},
        onLoadItems: function() {},
        onRenderComplete: function() {},
        customLoaderProc: !1,
        customTriggerProc: !1

只需将其值更改为 history: 0; 即可。