I'm trying to create a screenshot using javascript of a div element which contains a embed swf. This screenshot should be saved to my FTP server.
The html does look like the following:
<div class="thumbnail" id="thumbnail">
<div style="background: #FFF url('assets/images/canvas.png') repeat;" id="builder" class="thumb">
<object>
<embed width="100%" height="350" src="http://assets.zwinky.com/assets3/avatar/avatar10.8.swf?u=dane" wmode="transparent"></embed>
<param name="wmode" value="transparent">
</object>
</div>
</div>
And my current Javascript does look like the following:
<script type="text/javascript" src="assets/js/FileSaver.js"></script>
<script type="text/javascript" src="assets/js/html2canvas.js"></script>
<script type="text/javascript">
$(function() {
$("#submit_form").click(function() {
html2canvas($("#thumbnail"), {
onrendered: function(canvas) {
theCanvas = canvas;
document.body.appendChild(canvas);
canvas.toBlob(function(blob) {
saveAs(blob, "test.png");
});
}
});
});
});
</script>
But sadly nothing will save or happen once I'm clicking the button.
Example of working code: http://jsfiddle.net/6FZkk/1/
Screenshot of the HTML element containing the embed: https://gyazo.com/37683328b5a785e6b17f78eca5e1c2de
Does anyone have a idea what im doing wrong?