Android:浏览器后退按钮不会触发 $getJSON 事件
我有一个测试项目,它使用 $getJSON 从 Geonames 等 Web 服务和我们自己的专有服务中提取数据。索引页面使用两个 $getJSON 调用,当您首次加载页面或按刷新时,它们都可以正常加载。但是,如果您导航到另一个页面,然后单击后退按钮返回索引页面,则该页面将开始重新加载,并在遇到 $getJSON 调用时停止。我读过有关 Android 浏览器在 2.1(我正在使用的)中不能很好地缓存后退按钮的内容 - 只要它实际上完全加载了页面,我就可以接受页面重新加载。
我已经在 Firefox 中尝试过此操作,它会缓存索引页面,因此不会重新运行 JSON 调用。这就是为什么我在这里以 Android 的身份询问它——这纯粹是无缓存后退按钮的问题,还是我可以对 $getJSON 调用进行一些更改?
这是页面: http://MPulsemobile.info
I have a test project that uses $getJSON to pull data from web services like Geonames and our own proprietary services. The index page uses two $getJSON calls, and they load fine both when you first load the page or press the refresh. However, if you navigate to another page and then hit the back button to go back to the index page, the page begins reloading and just stops when it hits the $getJSON calls. I've read about Android browser not caching well with the back button in 2.1 (what I'm using)- I'm fine with page reloads as long as it actually completely loads the page.
I've tried this in Firefox and it caches the index page, so there's no re-running of the JSON calls. That's why I'm asking it here in an Android capacity- is it purely the no-caching back button thing that is the problem or is there something I could change about my $getJSON calls?
Here's the page:
http://MPulsemobile.info
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我的经验是,Android 浏览器不会像其他浏览器那样报告后退按钮的事件。
假设您有一个包含文本字段的表单,并且该文本字段包含 3 个字符。
创建一个 JavaScript 警报,该警报将在
keyup()
上触发并开始删除字符。在最后一次按键之前,警报不会触发。My experience is that the Android browser does not report events for the back button like other browsers.
Imagine you have a form containing a text field, and the text field contains, say, 3 characters.
Create a JavaScript alert that will fire on
keyup()
and begin deleting characters. The alert will not fire until the final key up.