在localStorage中存储对象数组并读取的方法
2017-02-06
19
频繁ajax请求导致页面响应变慢。于是考虑将数据存储在window.storage中,这样只请求一次ajax,而不需要频繁请求。鉴于localstorage中只能存储字符串,所以我们要借助于JSON.stringify()和JSON.parse();$.ajax({type: "get",async: "true",url: "",data: {},dataType: "jsonp",success: function(data){if(data inst...