0

遵循 Javascript:

在职的

            //Going to set on local storage on an iPhone
            window.localStorage.setItem("emailaddress", "test@test.de");
            //Loading local storage
            var storage = window.localStorage.getItem("emailaddress");
            alert(storage); //test@test.de 
            var servicename = "test";
            window.plugins.keychain.getForKey(storage, servicename);

不工作

            //Going to set on local storage on an iPhone
            window.localStorage.setItem("emailaddress", "test@test.de" + ":1");
            //Loading local storage
            var storage = window.localStorage.getItem("emailaddress");
            var array = new Array();
            var array = storage.split(":");
            var emailaddress = array[0];
            alert(emailaddress); //test@test.de
            var servicename = "test";
            window.plugins.keychain.getForKey(emailaddress, servicename);

为什么?实际上我需要第二个,因为我想存储的不仅仅是电子邮件地址,例如电子邮件地址/状态/时间戳......

4

0 回答 0