obtained base64 content for data:,
on the Internet to find a lot, did not find a solution!
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://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);
}
})
});
Previous: Update mechanism for applications such as nails
Next: Es6 Module question