【发布时间】:2019-12-05 17:36:36
【问题描述】:
当我在 Firefox 控制台中运行此代码时,我得到了未定义的返回值并打开了一个空白页
let m=$.getScript("https://html2canvas.hertzen.com/dist/html2canvas.js", function() {
html2canvas(document.querySelector("body > table.troisbords > tbody > tr > td > table > tbody > tr > td > div > blockquote > table > tbody > tr:nth-child(2) > td > form > table > tbody > tr:nth-child(4) > td:nth-child(2) > img"), {
onrendered: function(canvas) {
var myImage = canvas.toDataURL("image/png");
return myImage;
},
allowTaint: true,
taintTest: false
});
});
m.then((value) => {
console.log(value);
window.open(value);
});
但 Firefox 控制台显示有一个带有我需要的图像的渲染画布
check screenshot of the firefox console
请问我怎样才能得到这张图片?
谢谢
【问题讨论】:
标签: javascript jquery promise console.log html2canvas