jQuery:在子窗口上接收文档准备就绪()

标签 jquery dom window ready

当我打开的子窗口的文档已加载并准备就绪时,我试图收到通知。这似乎不起作用:

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
    });

我必须做什么?

最佳答案

你试过这个吗? —

$(win.document).ready(function() {
    $(win.document).contents().find("...").doStuff();
});

This question讨论非常相似的事情。重复?

关于jQuery:在子窗口上接收文档准备就绪(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4842432/

相关文章:

c# - WPF强制按下MouseDevice

c# - 管理双屏最大化功能

javascript - 如何在jquery/JS中引用对象数组?

javascript - 设置 jquery Datepicker 的最小/最大日期

jquery - Twitter 需要 Bootstrap 轮播优化解决方案

jquery - jQuery 中的 "Which child of its parent am I?"

dom - 使用 JQuery event.target 与 child 一起工作

javascript - 是否可以让我的 firefox 扩展程序获得对其他程序的关注?

使用 div 进行 Javascript Png 透明度 hitTest 检测

javascript - 创建 DOM 元素 : createElement, 添加属性等与创建它们的字符串然后追加之间的区别