【JS】两种前端普通文件下载方法
//本标签页下载 window.location.href = url; //新标签页下载 var downloadTag = document.createElement('a') downloadTag.target = '_black'; downloadTag.href = url; downloadTag.click();
//本标签页下载 window.location.href = url; //新标签页下载 var downloadTag = document.createElement('a') downloadTag.target = '_black'; downloadTag.href = url; downloadTag.click();