有两个页面,父窗口a.jsp如下:
<div class="formBox" id="formBox" style="display: none;">
<iframe width="100%" height="1000" src="" frameborder="0" scrolling="no" name="resultIframe" id="resultIframe"></iframe>
</div> 
子窗口b.jsp是iframe指向的页面,现在怎么在父窗口a.jsp里面操作获取子页面

解决方案 »

  1.   

    document.frames['resultIframe'].document.body.innerHTML
      

  2.   

    我是要获取子页面中一个div对象,代码是这样写的:var resultBox =document.frames['resultIframe'].document.getElementsById("xiao");
    但是总是报错,对象不支持此属性或方法
      

  3.   


     window.parent.$("#formBox") //做你想做的
      

  4.   

    function getDocument(id){
            var doc;        if (document.all){//IE
                    doc = document.frames[id].document;
            }else{//Firefox    
                    doc = document.getElementById(id).contentDocument;
            }
            return doc;
    }