Html2canvas.js reported an error

clipboard.png

 

obtained base64 content for data:,
on the Internet to find a lot, did not find a solution!


I have never encountered such a situation, so I searched it:

https://www.v2ex.com/t/455984

https://github.com/niklasvh/h...


I can try it with your js: codepen example

can you also post the html? And what is the version of html2canvas?


here comes the answer!
Thank you!

the old version introduced, the version number is html2canvas 0.4.1

here is the execution method!

$(document).ready(function () {
    var imgBlob = "";
    event.preventDefault();
    html2canvas(document.getElementById("demo"), {
        allowTaint: false,
        taintTest: true,
        logging: true,
        useCORS: true,
        background: "-sharpfff",
        onrendered: function (canvas) {
                imgBlob = canvas.toDataURL('image/jpeg', 1.0);
                imgBlob = imgBlob.toString().substring(imgBlob.indexOf(",") + 1);
                imgBlob = 'data:image/jpeg;base64,' + imgBlob;
                $('-sharptext').text(imgBlob);
            }
    })
});
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1c25ed0-3379d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1c25ed0-3379d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?