html2canvas兼容ie9,html2canvas.js not Working in IE9/10/11

在尝试使用html2canvas.js API捕获网页中IFrame内的Div元素截图时,遇到兼容性问题,该代码在Firefox和Chrome上运行正常,但在IE9/10/11中失败。错误信息提示'getComputedStyle'方法未被支持。问题可能源于html2canvas.js在IE浏览器的兼容性处理。寻求解决方案或替代方法以实现IE浏览器的截图功能。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

We want to capture screenshot of Div (HTML element) which is inside an IFrame. IFrame loads inside another Div at runtime in a html page. For capturing screenshot we are using html2canvas.js API.

Code is working very well with Mozilla and Chrome but not working in IE9/10/11.

The basic requirement is that to capture screenshot of Div and send that image byte-array to Flex application.

Function which captures screenshot is:

function capturImage() {

html2canvas(document.getElementById('map_canvas'), {

proxy: "server.js",

useCORS: true,

onrenderd: function (canvas) {

var imageData = canvas.todataURL('image/png', 1.0);

imageDataOnly = imageData.split(",");

falshObj.getImage(imageDataOnly[1]);

}

});

}

Error In IE:

SCRIPT438: Object doesn't support property or method 'getComputedStyle' File: html2canvas.js, Line: 2269, Column: 5

Please let me know if anyone had similar experience or has any clue in resolving the issue.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值