其他分享
首页 > 其他分享> > 导出多个文件

导出多个文件

作者:互联网

const iframe = document.createElement("iframe");
         iframe.style.display = "none"; // 防止影响页面
         iframe.style.height = 0; // 防止影响页面
         iframe.src = requestUrl;
         document.body.appendChild(iframe); // 这一行必须,iframe挂在到dom树上才会发请求
         // 5分钟之后删除(onload方法对于下载链接不起作用,就先抠脚一下吧)
         setTimeout(()=>{
             iframe.remove();
         }, 5 * 60 * 1000);

 

标签:文件,style,防止,多个,appendChild,导出,iframe,document,页面
来源: https://www.cnblogs.com/xueblvip/p/15910750.html