localstorage的使用
var localstroage = window.localStorage;
localstroage.setItem('openid','ksjhfkjajkdfjkszdjfksad'); localstroage.setItem('uid','10001');
var openid = localstroage.getItem('openid');
localstroage.removeItem('openid');
localstroage.clear();
localStorage.uid = 1;localStorage.sex='nan';localStorage.age = 23;for ( var i = 0, len = localStorage.length; i <br> 注意:1. 如果不主动删除 localstorage 是不会自动清空的 不会像cookie一样清除 <br> <p></p> <p> 2. localstorage 几乎支持大部分浏览器 不用考虑IE8 的问题 大小为 5M<br> </p> <p><br> </p>