gpt4 book ai didi

javascript - 如何让 html2canvas 在 ie8 中工作?

转载 作者:行者123 更新时间:2023-12-02 16:54:29 25 4
gpt4 key购买 nike

我正在尝试运行这个简单的 html2canvas代码。它在 Chrome, IE9, Firefox 中效果很好。但在 IE8 中不起作用

代码:

html2canvas($(#section), {
onrendered: function (canvas) {
var img = canvas.toDataURL().replace(/^data[:]image\/(png|jpg|jpeg)[;]base64,/i, "");

$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "/Home/SaveDiv",
data: "{'imageData': '" + img + "'}",
dataType: "json",
async: false,
cache: false,
success: function (msg) {
},
error: function (result) {
alert('error');

}
});
}
});

有什么办法可以让它在 IE8 中工作吗? 。我听说过flashcanvas我不确定如何使用它。

Else, is there any other way I can capture <div> element in IE8.

最佳答案

这可能是因为 html2canvas 需要 IE9 或更高版本,如所述 here .

关于javascript - 如何让 html2canvas 在 ie8 中工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26287626/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com