Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

150
Views
How can I fix error in html2canvas library

I was using html2canvas to convert an image in base 64 and send it through PHP and thus store it as a Blob, at first it worked correctly and when I decoded it it showed me the image, but now it shows me this error in the library and I don't know why it happens.

The error is the following:

documentClone.replaceChild(documentClone.adoptNode(cloner.documentElement), documentClone.documentElement);

When I execute the event to take the capture of my html, I get an error in the library code, and my code sends me a base64 image but it does not exist, because the library did not take any capture of my html.

This is my javascript with which I send the image in base64

    html2canvas(document.body).then(function (canvas){

        var ajax = new XMLHttpRequest();
        var num = Math.floor(Math.random()*10000);
        ajax.open("POST", "save-any.php", true);
        ajax.setRequestHeader("Content-type", "application/x-www-form-urlencoded")
        ajax.send("num=" + num + "&image=" + canvas.toDataURL("image/jpeg", 0.9));


    });
}

What happens to me is that the library does not save me any image but it generates a url that does not lead to any image.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!