QuotaExceededError:Dom异常22:尝试向存储中添加超出配额的内容 [英] QuotaExceededError: Dom exception 22: An attempt was made to add something to storage that exceeded the quota

查看:2520
本文介绍了QuotaExceededError:Dom异常22:尝试向存储中添加超出配额的内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在iOS 7上使用iPhone上的LocalStorage会引发此错误。我一直在寻找解决方案,但考虑到我甚至没有私人浏览,没有任何相关的。

Using LocalStorage on iPhone with iOS 7 throws this error. I've been looking around for a resolvant, but considering I'm not even browsing in private, nothing is relevant.

我不明白为什么localStorage会被禁用默认情况下在iOS 7中,但它似乎是?我也在其他网站上测试过,但没有运气。我甚至尝试过使用这个网站进行测试: http://arty.name/localstorage.html ,但它看起来不像它会保存任何东西,出于某种奇怪的原因。

I don't understand why localStorage would be disabled by default in iOS 7, but it seems it is? I've tested on other websites as well, but with no luck. I even tried testing it using this website: http://arty.name/localstorage.html, but it doesn't seem like it's saving anything at all for some weird reason.

有没有人有同样的问题,只有他们有运气修复它?我应该切换存储方式吗?

Has anyone had the same problem, only they've had luck fixing it? Should I switch my storage method?

我试图通过只存储几行信息来努力调试它,但无济于事。我使用标准的 localStorage.setItem()函数来保存。

I tried hard-debugging it by only storing a few lines of information, but to no avail. I used the standard localStorage.setItem() function to save.

推荐答案

当Safari处于私人模式浏览时,可能会发生这种情况。在私密浏览中,根本没有本地存储。

This can occur when Safari is in private mode browsing. While in private browsing, local storage is not available at all.

一种解决方案是警告用户该应用需要非私人模式才能使用。

One solution is to warn the user that the app needs non-private mode to work.

更新:这已在 Safari 11 ,因此行为现在与其他浏览器保持一致。

UPDATE: This has been fixed in Safari 11, so the behaviour is now aligned with other browsers.

这篇关于QuotaExceededError:Dom异常22:尝试向存储中添加超出配额的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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