history.back()不工作的Safari在iOS上 [英] history.back() doesn't work in Safari on iOS

查看:842
本文介绍了history.back()不工作的Safari在iOS上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序是基于AngularJS 1.2.3。该应用程序是为iOS的一个web应用程序启用。该应用程序包含回用以下code

My app is based on AngularJS 1.2.3. The application is enabled as a web app for iOS. The app contains back buttons with onclick handlers with the following code

history.length && history.back()

我还使用 history.go(-1),以及尝试。问题是,浏览器不会导航回在历史上的Safari iOS或当应用程序保存到主屏幕作为一个Web应用程序。有一件事我觉得奇怪但是,它工作正常在Chrome上的Safari浏览器,为Chrome浏览器实际上是Safari浏览器引擎。

I've also tried using history.go(-1) as well. Problem is, the browser doesn't navigate back in history in Safari on iOS, or when the app is saved to the home screen as a web app. One thing i find weird however is that it works fine in Chrome on Safari, as Chrome actually is the Safari browser engine.

我知道它以前的工作,但不会再因为某种原因。 iPad是运行iOS 7.0.4。

I know it have worked before, but doesn't anymore for some reason. The iPad is running iOS 7.0.4.

推荐答案

如果您正在使用应用程序缓存history.back不能在iOS7工作(检查的http://www.sencha.com/blog/the-html5-scorecard-the-good-the-bad-and-the-ugly-in-ios7/).

If you are using AppCache history.back will not work on iOS7 (check http://www.sencha.com/blog/the-html5-scorecard-the-good-the-bad-and-the-ugly-in-ios7/).

所以,如果是这样的问题,最简单的解决办法是禁用应用程序缓存。

So if that's the problem, the easiest solution is to disable AppCache.

这篇关于history.back()不工作的Safari在iOS上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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