码迷,mamicode.com
首页 > 其他好文 > 详细

^_^QUOTA_EXCEEDED_ERR: DOM Exception 22

时间:2014-09-12 14:41:53      阅读:286      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   color   io   os   ar   div   sp   

iOS的Safari在无痕模式下,sessionStorage操作产生异常,报错QUOTA_EXCEEDED_ERR: DOM Exception 22。

html5 localStorage error with Safari: “QUOTA_EXCEEDED_ERR: DOM Exception 22: An attempt was made to add something to storage that exceeded the quota.”

function isLocalStorageNameSupported() {
  var testKey = ‘test‘, storage = window.sessionStorage;
  try {
    storage.setItem(testKey, ‘1‘);
    storage.removeItem(testKey);
    return true;
  } catch (error) {
    return false;
  }
}

调试

try {} catch(error) {alert(error)} 

 

^_^QUOTA_EXCEEDED_ERR: DOM Exception 22

标签:style   blog   http   color   io   os   ar   div   sp   

原文地址:http://www.cnblogs.com/jzm17173/p/3968226.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!