以编程方式返回jquery-mobile navigationg

1 jquery-mobile

我有一个用户可以从应用程序的不同部分到达的页面.此外,通过此着陆页,用户可以导航到另一个页面并返回此着陆页.

使用默认的后退按钮功能将使用户返回该页面.简而言之,我需要在用户第一次到达此页面时保留URL,而不是changePageto此URL.

任何帮助表示赞赏.

Mar*_*ere 7

$.mobile.back()

它甚至可以处理转换反向.从来源:

$.mobile.back = function() {
    var nav = window.navigator;

    // if the setting is on and the navigator object is
    // available use the phonegap navigation capability
    if( this.phonegapNavigationEnabled &&
        nav &&
        nav.app &&
        nav.app.backHistory ){
        nav.app.backHistory();
    } else {
        window.history.back();
    }
};
Run Code Online (Sandbox Code Playgroud)