【问题标题】:jQuery iframe parent in firefox not workingFirefox中的jQuery iframe父级不起作用
【发布时间】:2012-12-11 03:44:04
【问题描述】:

在 Firefox 中,这行代码似乎不起作用:

iframeWin.refreshImgList();

但是,上面的相同代码适用于所有其他浏览器(甚至 IE...GASP!)。

iframeWin 是 iframe 的 id。我在 iframe 之外,试图调用 iframe 内部的函数 refreshImgList

我需要在上面的代码中添加/编辑什么,以使其在 FF 中的工作方式与在所有其他浏览器中的工作方式相同?

【问题讨论】:

  • 您在哪里使用此代码?在 iframe src 的 javascript 里面?
  • @user10:它是从 iframe 中调用的。页面幻灯片在主页上(在 iframe 之外)
  • @user10:感谢您的链接,但这不起作用。更新了我的 OP。
  • 发生了什么?它应该可以工作..你可以创建简单的小提琴来尝试吗?

标签: jquery iframe jquery-selectors


【解决方案1】:

啊!找到解决方案:

$("#iframeWin")[0].contentWindow.refreshImgList();

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-06-30
    • 2012-11-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多