0

I am trying to run this simple html2canvas code. It work great in Chrome, IE9, Firefox. But is not working in IE8

Code:

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');

                }
            });
        }
        });

Is there a way I can get it working in IE8. I have heard about flashcanvas which I am not sure on how to use it.

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

4

2 回答 2

1

我建议使用 polyfill:这是一个画布

于 2014-10-09T20:55:43.870 回答
1

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

于 2014-10-09T20:57:42.457 回答