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
I had the same issue and JoeCortopassi is only partly right: it is caused by private browsing being enabled. The code provided in that answer does not help much though. When I tested on iPad Safari(ios5) I got
console.log(!!window.localStorage); // true
As soon as I try to set a value, I get an exception:
localStorage.setItem("test", "test") // Exception 22 is thrown
So to accurately test for local storage support, it is necessary to try and set a value in local storage, for example:
var localStorageSupported = function() {
try {
localStorage.setItem("test", "test");
localStorage.removeItem("test");
return true;
} catch(e){
return false;
}
}