title: Uncaught (in promise) Provided element is not within a Document
body: <p>I am trying to screenshot  and download it to server, but still getting error. It´s a Wordpress BTW.</p>
  
  <blockquote>
    <p>Uncaught (in promise) Provided element is not within a Document</p>
  </blockquote>
  
  <p>jQuery</p>
  
  <pre><code>&lt;script&gt;
  function takeScreenshot(){
  var element = jQuery("#vpc-preview");
  html2canvas(element,{
  background:'#FFFFFF',
  onrendered:function(canvas){
  var imgData = canvas.toDataURL('image/jpeg');
  $.ajax({
  url:'/wp-content/plugins/html2canvas/save.php',
  type:'post',
  dataType:'text',
  data:{base64data:imgData}
  });
  }
  });
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>Any help?</p>