html本地存储尝试
2014-06-03 16:14
337 查看
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>html本地储存</title> </head> <body> <div id="count">此处显示 class "count" 的内容</div> <script> (function(){ if(window.localStorage){ var storage = window.localStorage; if (!storage.getItem("pageLoadCount")) storage.setItem("pageLoadCount",0); storage.pageLoadCount = parseInt(storage.getItem("pageLoadCount")) + 1;//必须格式转换 document.getElementById("count").innerHTML = storage.pageLoadCount; //localStorage.removeItem("pageLoadCount"); //window.localStorage.clear(); } else { alert('This browser does NOT support localStorage'); } })() </script> </body> </html>
相关文章推荐
- 深入HTML5: HTML5 本地存储( Local Storage )的前世今生 (一)
- HTML 本地存储
- HTML5+规范:Storage(管理应用本地数据存储区)
- html本地存储localStorage和sessionStorage存对象
- html本地存储方式实现的五线谱在线识谱练习应用
- 使用 HTML 5 开启移动 Web 应用程序的本地存储
- HTML5+的离线本地存储方案
- html本地存储对像以及模板juicer插件的使用
- Html本地数据存储Web Storage
- HTML 5 本地存储----LocalStorage 小DEMO
- HTML 5的本地存储
- html本地存储
- HTML 5中几种用于在客户端本地存储数据的API之间的比较
- HTML本地存储之IndexedDB(1)
- 深入HTML5: HTML5 本地存储( Local Storage )的前世今生 (一)
- [HTML] 使用HTML5的本地存储localStorage
- Android Aquery下载html修改后存储到本地
- HTML5-Database Storage 本地存储.html
- html 本地存储(localStorage and sessionStorage)