//iframe下载文件 function downloadFileByIfr(downLoadUrl) { // 移除旧的节点 const oldNode = document.querySelector("#g-exportOrder-iframe") if (oldNode) { document.body.removeChild(document.querySelector("#g-exportOrder-iframe")) } // 生成新节点,进行下载 const iframe = document.createElement("iframe") iframe.style.display = "none" iframe.id = "g-exportOrder-iframe" iframe.src = downLoadUrl document.body.appendChild(iframe) }
标签:文件,const,exportOrder,iframe,oldNode,document,下载 From: https://www.cnblogs.com/mengff/p/16790845.html