标签:
同key以数组形式存储
<script type="text/javascript"> var w = function(k, v) { k = k.toLowerCase(); var value = r(k); if (value) { var JValue = JSON.parse(value); var JV = JSON.parse(v); JValue[JValue.length] = JV; window.LS.set(k, JSON.stringify(JValue)); } else { var JV = JSON.parse(v); var JValue = [] JValue[JValue.length] = JV; window.LS.set(k, JSON.stringify(JValue)); } }; var r = function(key) { key = key.toLowerCase(); return window.LS.get(key); }; </script>
window.LS
window.sessionStorage
标签:
原文地址:http://www.cnblogs.com/zno2/p/5113103.html