我正在将内容从一帧复制到另一帧。我的代码在 Mozilla Firefox 中运行,但在 Google Chrome 中不起作用。有人能告诉我哪里出错了吗?
这部分不在 Google chrome 中执行:
$('#frame1').load(function(e){
});
下面是我的代码块:
$headContent = $("#mainframe").contents().find("head").html();
$bodyContent = $("#mainframe").contents().find("body").html();
$('<iframe />');
$('<iframe />',{ id: 'frame1',
class:'myframe',
height: 600,
width: "100%"
}).appendTo(uxcontainerPath);
$('#frame1').load(function(e){
console.log("Executed #frame1 load"); //this console line is not executed in chrome
$(this).contents().find('html').append('<head></head>');
$(this).contents().find('head').append($headContent);
$(this).contents().find('body').append($bodyContent);
});