history.back()不工作在phonegap ios构建 [英] history.back() not working in phonegap ios build
问题描述
目前为ios创建一个漂亮的phonegap构建,在浏览器中运行良好,然而,当我在Xcode中编译它并在模拟器中运行history.back()我使用不起作用。 / p>
我需要history.back()才能在应用程序的每个页面上创建一个返回按钮。
有没有人知道为什么会是这种情况,或一个替代解决方案。
更多信息:使用ember js的phonegap构建
究竟。在几个版本的iOS,Android(旧),history.back()似乎不工作。要解决它,你应该尝试这个代码(我发现它在JQM @@,它工作良好的所有)
var nav = window.navigator;
if(this.phonegapNavigationEnabled&&
nav&&
nav.app&&
nav.app.backHistory){
nav。 app.backHistory();
} else {
window.history.back();
}
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
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();
}
这篇关于history.back()不工作在phonegap ios构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!