【问题标题】:How to access global iframe object如何访问全局 iframe 对象
【发布时间】:2013-04-19 10:36:02
【问题描述】:

当我在 iframe 中时,我可以使用 parent 来访问父级的全局变量

parent.$('.selector').remove();

它将访问父级的 jQuery 并从 dom 中删除选择器。我怎么能从父母那里做同样的事情。访问 iframe 全局对象?

【问题讨论】:

    标签: javascript iframe window


    【解决方案1】:

    我发现它是

    $('iframe')[0].contentWindow;
    

    【讨论】:

      猜你喜欢
      • 2016-05-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-05-16
      • 2015-08-30
      • 1970-01-01
      • 2012-05-13
      • 2011-08-25
      相关资源
      最近更新 更多