为什么的javascript:history.go(-1);不工作在移动设备上? [英] Why is javascript:history.go(-1); not working on mobile devices?

查看:1714
本文介绍了为什么的javascript:history.go(-1);不工作在移动设备上?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,一些背景:

我有presents搜索页面(HTML格式)到用户的应用程序。一旦标准已经填写和搜索按钮后,结果将显示在条件部分下方。在结果列表中,您可以通过点击一个链接,带你到一个新的页面查看单个结果的细节。在细节上,我已经包括了返回结果联系起来,像这样:

I have an application which presents a search page (html form) to the user. Once criteria have been filled out and the Search button is clicked, results appear beneath the criteria section. In the list of results, you can view the detail of an individual result by clicking a link which takes you to a new page. Within the detail page, I have included a Back to Results link like so:

<a href="#" onclick="history.go(-1);return false">Back to Results</a>

这在IE8 / 9,Safari浏览器,Firefox和Chrome在桌面上的伟大工程。但是,它不能在我的Andr​​oid手机,我的Andr​​oid模拟器或iPhone 3G上运行。我要指出,当我使用桌面上的链接,我立刻回到了似乎与我的结果搜索页面的缓存副本,而我放置在结果中相同的滚动位置。在移动设备上,它看起来好像来自服务器的页面重新加载,我的搜索​​条件消失,没有任何结果。

This works great in IE8/9, Safari, Firefox and Chrome on the desktop. However, it does not work on my Android phone, my Android emulator or the iPhone 3G. I should note that when I use the link on the desktop I am immediately returned to what seems to be a cached copy of my search page with results, and I'm placed at the same scroll position within the results. On the mobile devices, it appears as though the page reloads from the server, my search criteria disappear, and there are no results.

如果任何人有哪里开始寻找一个解决方案,我真的AP preciate它的任何想法!我还可以提供更多的细节是必要的。

If anyone has any ideas on where to start looking for a solution, I would really appreciate it! I can also provide more detail as necessary.

感谢您和问候,
CN

Thank you and regards, CN

推荐答案

使用:

    <a href="javascript:history.go(-1)">Back to Results</a>

即不是在的onclick ,但在的href - 这是工作

这篇关于为什么的javascript:history.go(-1);不工作在移动设备上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆