访问localStorage时,是否有其他人在iPad上收到QUOTA_EXCEEDED_ERR? [英] Is anyone else receiving a QUOTA_EXCEEDED_ERR on their iPad when accessing localStorage?
问题描述
我有一个用JavaScript编写的Web应用程序,可以通过Safari和iPhone在桌面上成功运行。
I have a web application written in JavaScript that runs successfully on the desktop via Safari as well as on the iPhone.
我们正在考虑将此应用程序移植到iPad上,我们遇到的问题是,当我们在localStorage中存储相对少量的数据时,我们看到QUOTA_EXCEEDED_ERR设备。我知道这个错误意味着什么,但我不认为我存储的所有数据都很多。
We are looking at porting this application to the iPad and we are running into a problem where we are seeing QUOTA_EXCEEDED_ERR when storing a relatively small amount of data within the localStorage on the device. I know what this error means, but I just don't think I'm storing all that much data.
还有其他人在做类似的事吗?看到/没有看到这个问题?
Is anyone else doing something similar? And seeing/not seeing this problem?
凯文......
推荐答案
我遇到了同样的问题,似乎在设置解决之前移除了密钥。
I had the same problem and it seems like removing the key before setting it solved it.
function setkey(key, val){
sessionStorage.removeItem(key);
sessionStorage.setItem(key, val);
}
这篇关于访问localStorage时,是否有其他人在iPad上收到QUOTA_EXCEEDED_ERR?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!