在IOS-6 Safari中无法访问localStorage [英] localStorage not accessible in IOS-6 Safari

查看:309
本文介绍了在IOS-6 Safari中无法访问localStorage的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法访问Safari(带有IOS-6的iPad)中的localStorage.

I am not able to access localStorage in Safari (IPad with IOS-6).

例如,以下代码在Windows上的所有浏览器和(在装有iOS-5的iPad上)都能正常运行,但在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"));

请帮助.

推荐答案

我能够通过关闭iPad上的私人浏览来解决此问题.我从参考文献中找到了解决方案: https://github.com/cloudhead/less.js/issues/312#issuecomment-2994845

I was able to fix the issue by turning off private browsing on the iPad. I came across the solution from the reference : https://github.com/cloudhead/less.js/issues/312#issuecomment-2994845

这篇关于在IOS-6 Safari中无法访问localStorage的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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