eligrey / eligrey/FileSaver.js

Duplicate Download on Browsers canvas.toBlob but works normally on local host

Open
#762 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
22k
Forks
4.3k
PR merge metrics
No merged PRs in 30d

Description

Greetings, I don't know what happens to my program but it runs without problems when I do it on localhost, but when I upload it to my web server it happens to me that it always downloads twice. that is, the same canvas element 2 times the same.

It happens to me with all browsers, both on mobile and on PC.

Anybody knows what could be the problem?

I leave the function here:

$(function() {
$("#btnSave").click(function() {
html2canvas($("#imgGenerator"), {
onrendered: function(canvas) {
theCanvas = canvas;
document.body.appendChild(canvas);
canvas.toBlob(function(blob) {
saveAs(blob, "logo.png");
document.body.removeChild(canvas);
});
}
});
});


});

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.