其他分享
首页 > 其他分享> > js下载文件防止白屏

js下载文件防止白屏

作者:互联网

思路:用js创建一个iframe,让后指定src为下载目录。

              var ifup = document.getElementById("xman-activity-export-downLoad-file");
              if(ifup) {
                document.body.removeChild(ifup);
              }
              var elemIF = document.createElement("iframe");
              elemIF.id='xman-activity-export-downLoad-file';
              elemIF.src = ret?.data?.value?.exportOSSKey;
              elemIF.style.display = "none";
              document.body.appendChild(elemIF);         

 

原文链接:https://blog.csdn.net/ashou706/article/details/82760477

标签:file,js,ifup,export,elemIF,downLoad,白屏,document,下载
来源: https://www.cnblogs.com/xuLessReigns/p/15186532.html