/封装模块化文件 新建的.js文件 var storage = { set(key, value) { localStorage.setItem(key, JSON.stringify(value)); }, get(key) { return JSON.parse(localStorage.get ...
分类:
Web程序 时间:
2018-06-14 15:08:08
阅读次数:
263
存储数据: window.localStorage.setItem('key', score1); window.localStorage.setItem('key1', zhi1); window.localStorage.setItem('key2', zhi2); window.localSt ...
分类:
Web程序 时间:
2018-06-14 11:28:40
阅读次数:
205
现今,常见的ios版本有9、10、11。ios上safari在无痕模式下,浏览器假装支持localStorage,并在全局window上暴漏了该方法,但是调用setItem进行保存的时候,就报Error: QuotaExceededError ... : The quota has been exc ...
分类:
移动开发 时间:
2018-06-12 17:11:21
阅读次数:
2211
最近在用H5做一个项目。其中有一个需求是在tab栏列表页点击列表数据进入详情页,当点击详情页的返回按钮时能够返回列表页并且不刷新数据同时还要保留原tab栏的状态。然后就开始想出一系列想法~~ 在这里先说一下sessionStorage的用法: 1、setItem存储value:(代码示例) sess ...
分类:
其他好文 时间:
2018-06-08 19:25:56
阅读次数:
186
1 class Foo: 2 def __getitem__(self, item): 3 print('-------->__getitem__') 4 return self.__dict__[item] 5 def __setitem__(self, key, value): 6 print(... ...
分类:
其他好文 时间:
2018-06-07 14:19:06
阅读次数:
129
Traceback (most recent call last): File "D:/Users/Administrator/PycharmProjects/untitled/venv/yingshe/chengyuanxiushifu.py", line 22, in <module> bbb[ ...
分类:
编程语言 时间:
2018-06-01 13:40:02
阅读次数:
200
七、__setitem__,__getitem__,__delitem__ class Foo: def __init__(self,name): self.name=name def __getitem__(self, item): print(self.__dict__[item]) def _ ...
分类:
其他好文 时间:
2018-05-31 17:24:03
阅读次数:
165
var num= sessionStorage.getItem("random"); if(!num|| num<=0){ num= parseInt(Math.random()* 10000000); } sessionStorage.setItem("random",num-100); $("s... ...
分类:
其他好文 时间:
2018-05-25 11:11:44
阅读次数:
158
localStorage 用于长久保存整个网站的数据,没有过期时间,除非手动去除。 sessionStorage 会话存储,临时存储,当用户关闭浏览器窗口后,数据被删除。 共同方法 以 localStorage 为例: 1. 设置缓存数据:localStorage.setItem(key,value ...
分类:
其他好文 时间:
2018-05-22 20:47:21
阅读次数:
148