浏览器运行调用download无法下载文件
我也不知道为什么,控制台里一切正常
我是直接把debugout.js里代码贴过来用的
不知道谁能调试通过
https://github.com/inorganik/debugout.js
this.downloadLog = function() {
var logFile = self.getLog();
var blob = new Blob([logFile], { type: 'data:text/plain;charset=utf-8' });
var a = document.createElement('a');
a.href = window.URL.createObjectURL(blob);
console.log("=============>a.href:"+ a.href);
a.target = '_blank';
a.download = self.logFilename;
document.body.appendChild(a);
a.click();
console.log("=============>a.click:");
document.body.removeChild(a);
window.URL.revokeObjectURL(a.href);
}