JSlocalStorage实现本地缓存的方法_javascript技巧: 代码如下: 本地缓存 var strKey = strKey; var storage = window.localStorage; function onStart(){ if(storage.getItem(strKey)!=null){ alert(storage.getItem(strKey)+'localStor
导读JSlocalStorage实现本地缓存的方法_javascript技巧: 代码如下: 本地缓存 var strKey = strKey; var storage = window.localStorage; function onStart(){ if(storage.getItem(strKey)!=null){ alert(storage.getItem(strKey)+'localStor
代码如下:
本地缓存
var strKey = "strKey"; var storage = window.localStorage;
function onStart(){ if(storage.getItem(strKey)!=null){ alert(storage.getItem(strKey)+'localStorage'); }else if(Cookie.read(strKey)!=null){ alert(Cookie.read(strKey)+'cookie'); } } function bendihuancun(){ var strValue = document.getElementById("username").value; if (storage) { storage.setItem(strKey, strValue); } else { Cookie.write(strKey, strValue); } } script>
JSlocalStorage实现本地缓存的方法_javascript技巧
JSlocalStorage实现本地缓存的方法_javascript技巧: 代码如下: 本地缓存 var strKey = strKey; var storage = window.localStorage; function onStart(){ if(storage.getItem(strKey)!=null){ alert(storage.getItem(strKey)+'localStor