localStorage存储数组以及取数组方法
var Array = ['A',' B ','C','D','E']
存:localStorage.setItem('arr',JSON.stringify(Array));取:
Array = JSON.parse(localStorage.getItem('arr'));
var Array = ['A',' B ','C','D','E']
存:localStorage.setItem('arr',JSON.stringify(Array));取:
Array = JSON.parse(localStorage.getItem('arr'));
本文标题:本地存储 localStorage/sessionStorage
本文链接:https://www.haomeiwen.com/subject/fkstnctx.html
网友评论