localStorag的一点见解

dot方法对localStorag方法进行键值操作

设值   
localStorage.hello = 'world';  
localStorage.zhangsan = 'lisi';  
取值:  
var value_of_hello_in_localStorage = localStorage.hello;  
var value_of_zhangsan_in_localStorage = localStorage.zhangsan  

get/set方法

设值:  
localStorage.setItem("hello", "world");  
localStorage.setItem("zhangsan", "lisi");  
取值:  
localStorage.getItem("hello");  
localStorage.getItem("zhangsan");  
posted @ 2016-12-10 13:06  云遮夏靥  阅读(478)  评论(0编辑  收藏  举报