【问题标题】:Access iframe content head using asp.net or javascript使用 asp.net 或 javascript 访问 iframe 内容头
【发布时间】:2012-10-08 11:25:00
【问题描述】:

我创建了一个带有 iframe 的 asp.net 页面。 iframe 有一个 HTML 页面。现在我通过 url Admin/Home.aspx#Personnel_Data 引用 HTML 内容。但它不起作用。请帮我解决这个问题。

【问题讨论】:

    标签: c# asp.net html iframe


    【解决方案1】:

    试试这些

    docment.getElementById('iframe').contentWindow.

    document.getElementById('FrameId').contentWindow.document.body.innerHTML

    document.getElementById('FrameId').contentWindow.document.body.outerHTML

    var doc = document.getElementById('FrameId').contentWindow.document;

    http://www.w3schools.com/jsref/dom_obj_frame.asp

    【讨论】:

    • 添加一个函数 function AccessiFrame() { var doc = document.getElementById('FrameId').contentWindow.document; var innerHTML = doc.body.innerHTML;警报(内部HTML); //或分配给其他地方或在文档对象中找到特定元素}
    • 请不要以w3schools作为参考!通常真的很糟糕:w3fools.com
    • 我看不出你的评论有什么意义。如果信息正确且可用,我当然会使用它。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-05-03
    • 1970-01-01
    • 1970-01-01
    • 2010-12-20
    相关资源
    最近更新 更多