http://docs.phonegap.com/en/1.2.0/phonegap_storage_storage.md.html#localStorage
Key Quick Example:
var keyName = window.localStorage.key(0);
Set Item Quick Example:
window.localStorage.setItem("key", "value");
Get Item Quick Example
var value = window.localStorage.getItem("key");
// value is now equal to "value"
Remove Item Quick Example:
window.localStorage.removeItem("key");
Clear Quick Example:
window.localStorage.clear();
If you use you javascript for both mobile and web, you can use this code to detect that enviroment:
var wl = window.location.href;
var mob = (wl.indexOf("android")>0);
http://stackoverflow.com/questions/15349237/handling-cookies-in-phonegap-cordova
全站熱搜
留言列表