PhoneGap iOS 5.1和localStorage [英] Phonegap iOS 5.1 and localStorage
问题描述
我在我的应用程序中使用localstorage保存一个值,它与PhoneGap一起使用,但是当Apple发布新的iOS 5.1时,我的应用程序现在不保存该值。
I was using localstorage for save one value in my App, that works with PhoneGap, but when Apple has released the new iOS 5.1, my App now doesn't save the value.
有人知道如何解决这个问题吗?
Does anybody know how to solve this problem?
非常感谢!
编辑:我输入我使用的代码:
I put the code I was using:
window.localStorage。 setItem(login,$('#login')。val());
I use it for save the value, and I use it for read the value:
但是当我关闭应用程序时,
function onDeviceReady() {
var login = window.localStorage.getItem("login");
if (login != null) {
$('#login').val(login);
}
}
推荐答案
在PhoneGap组中有一个大线程讨论这个问题。基本上是因为它们现在将localStorage视为一个临时项,可以随时删除。不要害怕工作中有非常聪明的人!
There was a large thread in the phonegap group that talked about this problem. Basically its because they now treat localStorage as a temp item which can be deleted at any point. Never fear there are very smart people at work!
这里是主题 - https://groups.google.com/forum/?fromgroups#!topic/phonegap/RJC2qA9sDnw
这里是代码 - http://pastebin.com/5881768B
这篇关于PhoneGap iOS 5.1和localStorage的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!