我正在尝试访问父窗口标头并尝试将其附加到ShellExecute
new
,window
内容为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();
。
答案 0 :(得分:0)
这是你缺少的一点:
window.open("", "w");
将打开一个空白窗口。
window.opener;
将为您提供对开启者(父)窗口的引用