var image = new Image();
image.src = canvas.toDataURL("image/png");
var link = document.createElement('a');
link.href = image;
link.download = 'Download.png';
document.body.appendChild(link);
link.click();
当我使用此脚本时,它会返回一个下载错误
(File not found)
为什么?
答案 0 :(得分:3)
更改
link.href = image;
到
link.href = image.src;