【问题标题】:jquery html() problems in CHROMEChrome 中的 jquery html() 问题
【发布时间】:2011-07-08 11:48:35
【问题描述】:

我的 HTML 中有一个 iframe。 从那个 iframe 我正在访问父窗口以检索具有 ID=result 的 DIV 的 HTML 代码

在 FF3、FF5 和 IE8 中一切正常,但在 Chrome 12 中却不行。 Iframe 中的代码是:

message = $(document, parent.window.document).contents().find('#resultsubmit').html();

但是,如果我删除 html() 方法 Chrome 是返回一个有效的对象(html 对象)

但是,一旦我添加 html() 来读取 de html,就会发生错误。

有什么线索吗?

【问题讨论】:

    标签: jquery google-chrome iframe


    【解决方案1】:

    使用这个:

    var message = $(parent.window.document).contents().find('#message').html();
    $('#target').html(message);
    

    【讨论】:

    • 也许我解释错了:我正在尝试检索消息的内容 (var message = $(parent.window.document).contents().find('#message').html( );)
    猜你喜欢
    • 2011-03-15
    • 2010-12-17
    • 2012-02-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-12-13
    • 1970-01-01
    相关资源
    最近更新 更多