![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
H5
jtzzz
这个作者很懒,什么都没留下…
展开
-
H5实现上传文件并即时预览
此处上传一张图片为例子。当我们用<img src="../images/l1.jpg">直接展示时,src请求的是外部文件,一般来说是服务器资源。意味着它需要向服务器发送请求,它占用服务器资源。现在H5提供了一种文件读取,如下:<input type="file" name="myFile" id="myFile" onchange="getFileContent原创 2018-11-14 14:22:02 · 6211 阅读 · 0 评论 -
H5 WEB存储实现——登陆时记住用户名或密码
此处用保存用户名为例,因为我们在外登陆时保存用户名居多。此处需用到localStorage和sessionStorage两种存储方式。sessionStorage 大小 5M 生命周期 -- 关闭当前页面就消失 活动范围 -- 当前页面 存储位置 -- 当前页面的内存中 API 设置- window.sessionStorage.se...原创 2018-11-14 16:36:56 · 5337 阅读 · 0 评论