ios – 在iPad Safari上的localStorage是否保持持续?

前端之家收集整理的这篇文章主要介绍了ios – 在iPad Safari上的localStorage是否保持持续?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我已经看到网络上的意见分歧.据说,从iOS 5.1开始,iPad上的 HTML5内容的本地数据存储不再保证是持久的,但是在苹果当前的Safari开发者页面( https://developer.apple.com/technologies/safari/html5.html)上,建议离线持久性被保证.

有没有人有任何最近的经验与这个问题,并能评论如何可靠的数据库HTML5的功能与Safari在iPad上?

解决方法

这可能足够的信息:
localStorage的w3c规范是:

The second storage mechanism (note: localStorage) is designed for storage that spans multiple windows,and lasts beyond the current session. In particular,Web applications may wish to store megabytes of user data,such as entire user-authored documents or a user’s mailBox,on the client side for performance reasons.

在Apple页面上:

Safari supports the latest HTML5 offline data storage features. Your application can store its information on the local machine using either a simple key/value-based data store,or a robust sql database. The data is stored locally and persists across launches of Safari so your application doesn’t need a network connection to access the data,improving startup time and overall performance.

搜索谷歌(和雅虎,因为一些反谷歌的怪胎)给了我:

In iOS 5.1 Apple have moved the location of localStorage files into a Caches folder which is subject to occasional clean up,at the behest of the OS,typically if space is short. It is likely that Apple have done this to stop localStorage being backed up to iCloud.

localStorage not accessible in IOS-6 Safari

I am not able to access localStorage in Safari (IPad with IOS-6).
For example,the following code is working fine in Windows on all browsers and on (iPad with iOS-5) but not in iOS-6:
localStorage.setItem(“var”,”5″);
alert(localStorage.getItem(“var”));

回答:

I was able to fix the issue by turning off private browsing on the iPad. I came across the solution from the reference : 07001

原文链接:https://www.f2er.com/iOS/330238.html

猜你在找的iOS相关文章