我正在使用 PhoneGap 构建 jQuery 移动应用程序。我必须使用 jQuery mobile 传递前一个页面的一些参数来打开一个新页面。为此,我尝试使用本地存储,如下所示:
$("li").click(function(){
console.log("hi");
var index = $(this).index();
console.log("index"+ index);
window.localStorage.setItem("date",userArray_date[index] );
window.localStorage.setItem("title",userArray_title[index] );
window.location.href='mypage.html';
});
在另一页上,我检索了如下值:
var display_date = window.localStorage.getItem("date");
var display_title = window.localStorage.getItem("title");
$("#Date_Leaf").append(display_date);
$("#Title_Leaf").append(display_title);
这在 Android 手机上可以正常工作,但在 Windows 7 手机上不起作用。有人能告诉我我要去哪里错了吗?
http://docs.phonegap.com/en/2.0.0/cordova_storage_storage.md.html#localStorage
尝试在 onDeviceReady 函数中使用本地存储
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)