javaScript有三种数据存储方式,分别是:sessionStoragelocalStoragecookier1.sessionStoragesessionStorage仅在当前会话下有效,关闭页面或浏览器后被清除;setItem(key,value)设置数据getItem(key)获取数据removeItem(key)移除数据clear()清除所有值<script>//添加数据window.sessionStorage.setItem("name","李四")window.sessionStorage.setItem("age",18)//获取数据console.log(window.sess...
继续阅读 >