当我打开的子窗口的文档已加载并准备好时,我试图得到通知。这似乎不起作用:
win = window.open(href, 'test', 'width=300, height=400');
win.focus();
$(win.document).ready(function() {
// Ok, the function will reach here but if I try to manipulate the
// DOM it doesn't work unless I use breakpoints
$(this).contents().find("...").doStuff(); // nothing happens
});
我需要做什么?