Iphone localStorage “QUOTA_EXCEEDED_ERR” issue

前端 未结 5 1981
孤街浪徒
孤街浪徒 2020-12-30 02:19

I trying to use Client Side Storage available in HTML5 (localStorage) for Iphone Application , and I\'m completely aware of the \"QUOTA\" associated for loc

5条回答
  •  太阳男子
    2020-12-30 02:53

    Go into Settings->Safari and check to see if private browsing is on. If it is, local storage will not be able to store anything. Here's some basic code to check local storage for you:

    if (!!window.localStorage) 
    {
        localStorage.setItem(key, val);
    };
    

    Also, how are you setting it? Are you using localStorage.setItem(key, val), or trying localStorage(key, val)? You're problem might be coming from setting it incorrectly

提交回复
热议问题