如何打开窗口并在该窗口中选择对象

How can I open a window and select objects in that window?

本文关键字:窗口 选择 对象 何打 开窗口      更新时间:2023-09-26

我有

newWindow=window.open(document.URL);
$('div#header',newWindow.document).hide();
$('div#footer',newWindow.document).hide();

但它似乎不起作用。有什么想法吗?

试试这个:

newWindow = window.open(document.URL);
$(newWindow).load(function() {
    $('#header', newWindow.document).hide();
    $('#footer', newWindow.document).hide();
});