有没有办法将 iframe 的内容复制到 jQuery 的弹出窗口中?
$(popUpWindow.document).append($('#iframe1').contents());
$(popUpWindow.document).append($('#iframe1').contents().find('body').html());
所有这些都不起作用!
谢谢
最佳答案
如果您实际上需要做的只是获取 iframe 内容,您可以尝试比 jquery 更底层的东西:原始 javascript!
var getIframeContent = function (id) {
var iframe = document.getElementById(id);
return iframe.contentWindow.document.body.innerHTML;
}
但我想在 JQuery 的底层也会发生类似的事情。
关于javascript - 如何将iframe的内容复制到弹出窗口中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5490854/