2012-06-06 139 views
0

感謝以前的答覆,如何使用PhoneGap的

我嘗試添加使用手機的差距聯繫人保存聯繫人,我用`

var phoneNumbers = []; 
phoneNumbers[0] = new ContactField('work', '1234567890', false); 
phoneNumbers[1] = new ContactField('mobile', '123456789', true); // preferred number 
phoneNumbers[2] = new ContactField('home', '1234567890', false); 
contact.phoneNumbers = phoneNumbers; contact.save(onSaveSuccess,onSaveError);` 

但這個代碼保存觸點谷歌。取而代之,我想存儲在本地聯繫人存儲中。是否有可能在本地存儲聯繫人。

請指導我弄清楚。

謝謝

回答

0
function writeLocalStorage() 
{ 
    window.localStorage.setItem("Username", "name"); 
    window.localStorage.setItem("ph_no", "no."); 
    //here code for get the item. 
} 

也許你可以根據自己的需求量的改變函數體,我希望它的工作!

更多參見here

+0

感謝您的立即回覆。我們如何使用此代碼存儲聯繫人。你能簡單地解釋我嗎? – RAAAAM

+0

在Chrome瀏覽器的幫助下,您可以通過工具 - >開發者工具 - > localstarage->本地文件來查看商店數據 – vikky