访问嵌套的iframe内容 [英] access nested iframe content

查看:119
本文介绍了访问嵌套的iframe内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含嵌套iframe的html页面。我想使用javascript访问子页面的内容或其中的输入值。

I have a html page which contains the nested iframe . I want to access the content of the child page or the value of input inside that using javascript .

推荐答案

如何访问嵌套的iframe? [ ^ ]

在IE中嵌套iframe中访问javascript函数 [ ^ ]



希望它有所帮助!
How to access nested iframes?[^]
Accessing a javascript function in a nested iframe in IE[^]

hope it helped!






您可以为iframe分配一些ID并使用该ID访问iframe控件并且能够获取iframe中的元素。



Hi,

you can assign your iframe some ids and use that id to access the iframe control and can able to get the elements inside the iframe.

<script type="text/javascript">
        function parent_function() {
            alert('parent');
        }
        function doit() {
            parent_function();
            document.getElementsByTagName('iframe')[0].contentWindow.iframe1_function();
            document.getElementsByTagName('iframe')[0].contentWindow.document.getElementsByTagName('iframe')[0].contentWindow.iframe2_function();
        }
    </script>







这可以帮助您理解。

上述链接也很有用。请仔细阅读。



谢谢




This may help you for understanding.
The above mentioned links are also useful. Please go through them.

Thanks


这篇关于访问嵌套的iframe内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆