我在使用$window.open()打开的新窗口中不能访问元素:
var printWindow = window.open(window.location.href, 'Imprimer', config = 'width=1024, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no');
printWindow.onload = function() {
printWindow.find(".navbar").remove();
}
这里,
printWindow.find(".navbar").remove();
这行代码不起作用。我试了几个jQuery选择器,但没法访问我的弹出框中的".navbar"。顺便提一下,这个应用程序也使用了AngularJS,也许与我的问题有关。
非常感谢您的帮助。
$window
是什么?你是不是想说window
呢? - A. Wolff