【发布时间】:2020-05-11 18:36:48
【问题描述】:
我正在使用 html2canvas 从我的 html 页面生成图像。
当我输入我的网址时 http://prompter.rareapps.org/prompt/prompt-save2.php?p=123
在 html2canvas 网站 (http://html2canvas.hertzen.com/screenshots.html) 的网页渲染器中,我的页面与背景正确渲染。
但是当我生成自己的画布时,我没有背景。这是我的代码
<script type="text/javascript">
$( document ).ready(function() {
html2canvas(document.body, {
allowTaint: true,
taintTest: false,
onrendered: function(canvas) {
window.location.href = canvas.toDataURL('image/jpeg');
}
});
});
我错过了什么?
谢谢
【问题讨论】:
-
谢谢。我尝试了他们推荐的修复方法,但没有一个对我有用。
标签: html background-image html2canvas