Jquery mobile 如何返回到某些previus页面jquery mobile

Jquery mobile 如何返回到某些previus页面jquery mobile,jquery-mobile,Jquery Mobile,我正在尝试使用jquery mobile 1.45实现这样的导航 第1页->第2页->第3页->返回第1页 如何导航到第1页从历史记录中删除第3页和第2页 这是可能的功能: function backCertainPages(cant) { var history = $.mobile.navigate.history.stack; history.splice(history.length - cant, cant); $.mobile.naviga

我正在尝试使用jquery mobile 1.45实现这样的导航

第1页->第2页->第3页->返回第1页

如何导航到第1页从历史记录中删除第3页和第2页

这是可能的功能:

    function backCertainPages(cant) {
      var history = $.mobile.navigate.history.stack;
      history.splice(history.length - cant, cant);
      $.mobile.navigate.history.stack = history;
      $.mobile.back();
}
但是我得到了一份工作

Uncaught Exception: Uncaught TypeError: Cannot read property 'lastScroll' of undefined at (compiled_code):6317WL.Logger.__log @ worklight.js:5064WL.Logger.$.each.PUBLIC_API.(anonymous function) @ worklight.js:5444WL.Logger.window.onerror @ worklight.js:5404
jquery.mobile-1.4.5.js:6317 

Uncaught TypeError: Cannot read property 'lastScroll' of undefined

我只是在我的转换中添加了
changeHash:false

$.mobile.pageContainer.pagecontainer("change", id, {
        transition : "pop",
        reverse : true,
        role : "back",
        changeHash: false
    });
并覆盖除第一页之外的所有后退按钮逻辑