访问父窗口的标题

时间:2015-07-03 18:44:21

标签: javascript jquery internet-explorer-8

我正在尝试访问父窗口标头并尝试将其附加到ShellExecute newwindow内容为div

print

我刚刚得到一个空白的新var headerPart = $("head").html(); var contentPart = $("#div").html(); var newWindow= window.open("", "w"); newWindow.document.getElementsByTagName('head')[0].appendChild(headerPart); $(newWindow.document.body).html(contentPart); newWindow.focus(); newWindow.print(); newWindow.close();

1 个答案:

答案 0 :(得分:0)

这是你缺少的一点:

window.open("", "w"); 

将打开一个空白窗口。

window.opener;

将为您提供对开启者(父)窗口的引用

相关问题