html2canvas.js不工作在IE9 / 10/11 [英] html2canvas.js not Working in IE9/10/11
问题描述
我们想要捕获在IFrame内的Div(HTML元素)的屏幕截图。 IFrame在运行时在html页面中加载另一个div。为了捕捉屏幕截图,我们使用了html2canvas.js API。
代码适用于Mozilla和Chrome,但不适用于IE9 / 10/11。 b
$ b
基本要求是捕获Div的屏幕截图并将该图像字节数组发送到Flex应用程序。
捕获屏幕截图的函数是:
函数capturImage(){
html2canvas(document.getElementById('map_canvas'),{
代理:server.js,
useCORS:true,
onrenderd:function(canvas){
var imageData = canvas.todataURL('image / png',1.0);
imageDataOnly = imageData.split(,);
falshObj.getImage(imageDataOnly [1]);
}
});
IE错误:
SCRIPT438:对象不支持属性或方法
'getComputedStyle'文件:html2canvas.js,行:2269,列:5
< blockquote>
请让我知道是否有任何人有类似的经历或有解决问题的线索。 / div>
根据此 gitHub问题(似乎由您填写),您不应该同时使用
代理
和useCORS
属性。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.
解决方案According to this gitHub issue (that seems to be filled by you), you should not use the
proxy
and theuseCORS
properties at the same time.这篇关于html2canvas.js不工作在IE9 / 10/11的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!