Phonegap后退按钮跳过页面
我有一个非常标准的 Android Phonegap 项目,设置如下
index.html:
<a href="http://www.something.com/">One</a>
<a href="test.html">Two</a>
test.html:
<p>Hello.</p>
phonegap.xml:
...
<access origin="http://www.something.com/" subdomains="false" />
...
当我运行这个时,我在使用后退按钮时遇到了一些奇怪的行为:
- 按 One。正如预期的那样,我出现在 http://www.something.com/
- 按手机的后退按钮。正如预期的那样,我再次出现在主屏幕上,
- 按二。正如预期的那样,我出现在 test.html 中
- 按手机的后退按钮。我出现在 http://www.something.com/,但应该出现在主屏幕上 再次
有人可以解释这种行为吗?如何在 test.html 上按后退按钮返回主屏幕(我来自的地方)?
I have a very standard Android Phonegap project with the following set up
index.html:
<a href="http://www.something.com/">One</a>
<a href="test.html">Two</a>
test.html:
<p>Hello.</p>
phonegap.xml:
...
<access origin="http://www.something.com/" subdomains="false" />
...
When I run this, I get some odd behaviour with the back buton:
- Press One. I appear at http://www.something.com/, as expected
- Press the phone's back button. I appear at the the home screen again, as expected
- Press Two. I appear at test.html, as expected
- Press the phone's back buton. I appear at http://www.something.com/, but should appear at the home screen again
Can anyone explain this behaviour? How can I have pressing the back button when on test.html return me to the home screen (where I came from)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我升级到了今天发布的Phonegap 1.4.0,现在运行得很好。
I upgraded to Phonegap 1.4.0, which happened to be released today, and it works perfectly now.
像这样覆盖后退键以返回主页或您想去的任何地方
Override the back key like this to get back to home page or where ever you want to go
您没有共享所有代码,因此很难判断问题出在哪里。
但对于此应用程序,您可以在这里找到解决方案:
Phone-Gap Redirect One and Two
如果您想要更多帮助简要分享您的代码。
You didn't share all of your code so it's difficult to judge where is the problem.
But for this application, you will find a solution here:
Phone-Gap Redirect One and Two
If you want more help share your code in brief.