One of our small applications, using the Baidu Map API to obtain the user's coordinates after using Localstorage to do the next cache, test on-line after the operation of the student Feedback page data pull,
The test did not find the problem, and 2 of the same iphone one can not be one, and finally locate the problem is localstorage.
But why is it obvious that the same version of the 2 mobile phone one can not be a single?
and 2 mobile phone printing localstorage is obviously an object, strange.
In the degree Niang did not find the answer, finally to Google found someone said isPrivate Browsing Mode引起的。然后查看IOS的safari没有发现隐私设置什么的
Then click on the lower right corner of the small box to find a non-mark browsing mode. MD, everything's fine after it's closed.
//Safari, in Private browsing Mode, looks like it supports localstorage but all calls to SetItem//throw quotaexceedederror. We ' re going to detect this and just silently drop any calls to SetItem//to avoid the entire page breaking, without has a check at each usage of Storage.if(typeofLocalstorage = = = ' object ') { Try{Localstorage.setitem (' Localstorage ', 1); Localstorage.removeitem (' Localstorage '); } Catch(e) {Storage.prototype._setitem=Storage.prototype.setItem; Storage.prototype.setItem=function() {}; Alert (' Your Web browser does not support storing settings locally. In Safari, the most common cause of that is using "Private browsing Mode". Some settings may not be save or Some features may isn't work properly for you. '); }}
Can Jiangzi judgment. Prompts the user to turn off the non-marking mode.
or http://stackoverflow.com/questions/14555347/. Html5-localstorage-error-with-safari-quota-exceeded-err-dom-exception-22-an there are other
People write some methods that I haven't tried. You guys can try.
Localstorage under Safari under iOS doesn't work