var fileName = 'download.txt';
var fileContent = 'helloWorld';
var a = document.createElement('a');
a.download = fileName;
a.href = window.URL.createObjectURL(new Blob([fileContent]));
a.click();
var fileName = 'download.txt';
var fileContent = 'helloWorld';
var a = document.createElement('a');
a.download = fileName;
a.href = window.URL.createObjectURL(new Blob([fileContent]));
a.click();
本文标题:js自动下载文件, 自动下载到浏览器中
本文链接:https://www.haomeiwen.com/subject/xqxubctx.html
网友评论