Kar*_*yan 8 html javascript jquery html2canvas
html2canvas.js没有捕获图像.它会留下图像出现的空白区域.
function capture()
{
html2canvas(document.body, {
allowTaint: true,
logging:true,
onrendered: function(canvas) {
imagestring = canvas.toDataURL("image/png");
console.log(imagestring);
document.body.appendChild(canvas);
}
});
}
Run Code Online (Sandbox Code Playgroud)
我已经尝试了很多,但我找不到解决方案.
感谢帮助:)
您需要在 html2canvas 中添加以下选项。
html2canvas(document.body, {
allowTaint : true,
useCors : true
}).then(function(canvas) { ... }
Run Code Online (Sandbox Code Playgroud)