javascript - html2canvas + FileSaver browser issues -
i'm working html2canvas , filesaver, save generated canvas when button clicked. dialog popup , user can choose save image , rename if wish. works perfectly... in firefox. can't seem work in either chrome, ie, or safari.
the html2canvas part, , create image out of div in of browsers. filesaver dialog box thing not work in aforementioned browsers.
any ideas? i've attached script. can see full working code here: https://jsfiddle.net/ticklishoctopus/556etja4/
script (with previous posts):
$(function () { $("#btnsave").click(function () { html2canvas($("#testbtn"), { onrendered: function (canvas) { thecanvas = canvas; document.body.appendchild(canvas); canvas.toblob(function (blob) { saveas(blob, "testimage.jpg"); }); } }); }); });
realised toblob not supported in chrome. use instead: possible solution