简体   繁体   English

html2canvas.js在IE9 / 10/11中不起作用

[英]html2canvas.js not Working in IE9/10/11

We want to capture screenshot of Div (HTML element) which is inside an IFrame. 我们想要捕获IFrame内部的Div(HTML元素)的屏幕截图。 IFrame loads inside another Div at runtime in a html page. IFrame会在运行时在HTML页面中加载到另一个Div中。 For capturing screenshot we are using html2canvas.js API. 为了捕获屏幕截图,我们使用html2canvas.js API。

Code is working very well with Mozilla and Chrome but not working in IE9/10/11. 代码在Mozilla和Chrome上运行良好,但在IE9 / 10/11中却无法运行。

The basic requirement is that to capture screenshot of Div and send that image byte-array to Flex application. 基本要求是捕获Div的屏幕截图并将该图像字节数组发送到Flex应用程序。

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: IE中的错误:

SCRIPT438: Object doesn't support property or method 'getComputedStyle' File: html2canvas.js, Line: 2269, Column: 5 SCRIPT438:对象不支持属性或方法“ getComputedStyle”文件:html2canvas.js,行:2269,列:5

Please let me know if anyone had similar experience or has any clue in resolving the issue. 如果有人有类似经验或解决问题的任何线索,请告诉我。

根据这个gitHub问题 (似乎由您填补),您不应同时使用proxyuseCORS属性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用Javascript和html2canvas.js的Div屏幕截图部分起作用 - Div Screenshot with Javascript and html2canvas.js partially working 使用html2canvas.js从html导出pdf的jsPdf无法处理大数据 - jsPdf using html2canvas.js for export pdf from html is not working for large data 绘图 <canvas> 使用不同的彩色标记html2canvas.js - Drawing on <canvas> using different coloured markers html2canvas.js 将html转换成image并保存?(使用html2canvas.js) - Convert the html into image , and save it ?(use html2canvas.js) html2canvas.js无法捕获动态生成内容的图像 - html2canvas.js not capturing image for dynamically generated content HTML画布到blob到IE9中的可下载文件,10 - HTML canvas to blob to downloadable file in IE9, 10 html2canvas.js | 将图像发送到服务器变量 - html2canvas.js | Send image to variable for server html2canvas 代码不工作 IE 11 - html2canvas code not working IE 11 如何使用html2canvas.js将带有@ font-face的SVG文本元素转换为画布? - How to convert SVG text element with @font-face to canvas using html2canvas.js? Javascript“切换器”功能不适用于IE9或IE10(IE8具有后备功能),但适用于IE11,Chrome,Firefox - Javascript “toggler” function not working in IE9 or IE10 (IE8 has a fallback in place) but working in IE11, Chrome, Firefox
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM