24
24
</ head >
25
25
< body >
26
26
< div id ="container ">
27
- < h1 > html2canvas 1.x with PHP proxy</ h1 >
27
+ < h1 > html2canvas 0.4.1 with PHP proxy</ h1 >
28
28
29
29
< p >
30
30
From imgur.com: < br >
@@ -45,27 +45,29 @@ <h2>Output results:</h2>
45
45
46
46
< script >
47
47
window . onload = function ( ) {
48
- html2canvas ( document . getElementById ( "container" ) , {
49
- "logging" : true , //Enable log (use Web Console for get Errors and Warnings)
50
- "proxy" : "../html2canvasproxy.php" ,
51
- "onrendered" : function ( canvas ) {
52
- var img = new Image ;
48
+ setTimeout ( ( ) => {
49
+ html2canvas ( document . getElementById ( "container" ) , {
50
+ "logging" : true , //Enable log (use Web Console for get Errors and Warnings)
51
+ "proxy" : "../html2canvasproxy.php" ,
52
+ "onrendered" : function ( canvas ) {
53
+ var img = new Image ;
53
54
54
- img . onload = function ( ) {
55
- img . onload = null ;
55
+ img . onload = function ( ) {
56
+ img . onload = null ;
56
57
57
- document . getElementById ( "output" ) . appendChild ( img ) ;
58
- } ;
58
+ document . getElementById ( "output" ) . appendChild ( img ) ;
59
+ } ;
59
60
60
- img . onerror = function ( ) {
61
- img . onerror = null ;
61
+ img . onerror = function ( ) {
62
+ img . onerror = null ;
62
63
63
- console . log ( "Not loaded image from canvas.toDataURL" ) ;
64
- } ;
64
+ console . log ( "Not loaded image from canvas.toDataURL" ) ;
65
+ } ;
65
66
66
- img . src = canvas . toDataURL ( "image/png" ) ;
67
- }
68
- } ) ;
67
+ img . src = canvas . toDataURL ( "image/png" ) ;
68
+ }
69
+ } ) ;
70
+ } , 5000 ) ;
69
71
} ;
70
72
</ script >
71
73
</ body >
0 commit comments