history.back() not working in phonegap ios build

瘦欲@ 提交于 2019-12-13 11:04:26

问题


Creating a nice little phonegap build for ios at the moment, runs fine in the browser, however, when I compile it in Xcode and run in the simulator the history.back() I'm using doesn't work.

I need the history.back() in order to create a back button on each page in the app.

Does anyone know why this may be the case, or an alternative solution.

More information: phonegap build using ember js


回答1:


Yes, exactly. In several version iOS, Android ( old), history.back() seem not working. To fix it, you should try this code ( i find it in JQM @@ and it working well for all )

            var nav = window.navigator;
            if( this.phonegapNavigationEnabled &&
                nav &&
                nav.app &&
                nav.app.backHistory ){
                nav.app.backHistory();
            } else {
                window.history.back();
            }


来源:https://stackoverflow.com/questions/20116050/history-back-not-working-in-phonegap-ios-build

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!