我正在尝试执行此代码,但无效:
function iframeLoad(iframe) {
var body = $(iframe).contents().find('body');
html2canvas(body, {
onrendered: function( canvas ) {
alert(canvas.toDataURL());
//this alert doesn't working
},
allowTaint: true,
taintTest: false,
logging: true
});
}
如果将var“body”更改为我页面上的正文(而不是iframe),则可以正常工作:
var body = $('body');
谢谢:D