![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
js
文章平均质量分 55
是后海大鲨鱼
这个作者很懒,什么都没留下…
展开
-
js兼容IE,谷歌的下载方法
var xhr = new XMLHttpRequest(); xhr.open('get', datas, true); xhr.responseType = "blob"; // 返回类型blob // 定义请求完成的处理函数,请求前也可以增加加载框/禁用下载按钮逻辑 xhr.onload = function() { // 请求完成 if(this.status === 200) { // 返回200 var blob = this.response; ...原创 2021-09-22 18:02:12 · 598 阅读 · 0 评论 -
解决浏览器下载文件的兼容问题
var xhr = new XMLHttpRequest(); xhr.open('get', datas, true); xhr.responseType = "blob"; // 返回类型blob // 定义请求完成的处理函数,请求前也可以增加加载框/禁用下载按钮逻辑 xhr.onload = function() { // 请求完成 if(this.status === 200) { // 返回200 var blob = this.response;.原创 2021-08-03 15:18:34 · 427 阅读 · 0 评论