Html2canvas not supporting in IE9 and IE 10
Hi,
I want to capture a particular div as an image and assign to textbox. I have used html2canvas. It works fine in Firefox, chrome and I.E11. But the code doesnot work in I.E 9 and I.E 10.
<script src="Scripts/html2canvas.js" type="text/javascript"></script>
<script type="text/javascript" src="Scripts/jquery.plugin.html2canvas.js"></script>
<script>
function capture() {
////////alert(1);
$('#d1').html2canvas({
onrendered: function (canvas) {
//Set hidden field's value to image data (base-64 string)
$('#img_val').val(canvas.toDataURL("image/png"));
img = $('#img_val').val();
//document.write('<img src="' + img + '"/>');
img = img.replace('data:image/png;base64,', '');
$('#img_val').val(img);
//alert(img);
}
});
}
function hdnClick() {
document.getElementById('btnhdn').click();
}
</script>
whereas
d1 is my div name and
img_val is my textbox name. When user clicks a button(
btnhdn) my image value(
img_val)
disappears in I.E 9 and I.E 10. Please help me how to resolve it.