localStorage.setItem(Key, value);
localStorage.Key=value;
localStorage.getItem(Key);
localStorage.key;
window.localStorage.removeItem('key')
a页面存值
localStorage.li='哈哈哈';//存放字符串或者json字符串
(如果是ajax返回的json对象,localStorage.li=JSON.stringify(data); 转字符串)
b页面取值
var str = localStorage.li; // 哈哈哈
(如果传的是json字符串,var obj=eval('('+localStorage.li+')'); 转json对象之后再使用)