js
雪春不想长大
这个作者很懒,什么都没留下…
展开
-
input type="number"可以输入字母e
input type=”number” 时只允许输入数字,但是字母e可以输入,原因是e在数学上代表2.71828,他是一个数字,所以能输进去。 解决办法为在input属性上加上: onKeypress=”return (/[\d]/.test(String.fromCharCode(event.keyCode)))” <input type="number" onKeypress=”re...原创 2019-03-02 09:30:56 · 1543 阅读 · 1 评论 -
H5视频、音频不能自动播放,Uncaught (in promise) DOMException
报错信息: 错误原因:Chrome的autoplay政策在2018年4月做了更改 解决办法: 1、在chrome浏览器访问:chrome://flags/#autoplay-policy 2、在Autoplay policy中将Default改为No user gesture is required 3、点击下方的“RELAUNCH NOW” ...原创 2019-03-02 16:01:16 · 1665 阅读 · 0 评论 -
a 文件下载 后端返回文件流格式
文件流转换 window.URL.createObjectURL(response) if(this.exportExcelLoading==false){ this.exportExcelLoading=true //避免重复请求的标识 $xh.http({ type: "get", //后端协商请求方式 responseType: "blob", ...原创 2019-02-21 11:49:56 · 1449 阅读 · 0 评论 -
window.requestAnimationFrame 代替settimeout
详情 https://developer.mozilla.org/zh-CN/docs/Web/API/Window/requestAnimationFrame转载 2019-03-12 19:32:41 · 354 阅读 · 0 评论