Skip to content

Instantly share code, notes, and snippets.

@andersonfreitas
Created September 24, 2012 02:24
Show Gist options
  • Save andersonfreitas/3773874 to your computer and use it in GitHub Desktop.
Save andersonfreitas/3773874 to your computer and use it in GitHub Desktop.
Snippet to load html2canvas in the actual page
this.scriptObject=document.createElement('script');
this.scriptObject.type='text/javascript';
this.scriptObject.src='http://html2canvas.hertzen.com/js/html2canvas.js';
var ssc = document.getElementsByTagName('script')[0];
ssc.parentNode.insertBefore(this.scriptObject, ssc);
this.scriptObject=document.createElement('script');
this.scriptObject.type='text/javascript';
this.scriptObject.src='http://html2canvas.hertzen.com/js/jquery.plugin.html2canvas.js';
var ssc = document.getElementsByTagName('script')[0];
ssc.parentNode.insertBefore(this.scriptObject, ssc);
$(document.body).html2canvas({logging: true, profile: true, useCORS: true });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment