父iframe分为上中下三部分,中间部分是个子iframe,子iframe分为左中右
如何在父iframe的上部,用js或取子iframe的中部的src属性

解决方案 »

  1.   

    首先,在父Iframe中,用contentWindow.document 获取子Iframe的文档对象
    然后,就是用这个对象.getElementById()啰
      

  2.   

    至于这个父Iframe的子Iframe的文档对象,假定这个子iframe为:iframe1,
    不同浏览器的代码为下面
    FF,NS:iframe1.contentDocument
    IE8以下:iframe1.Document
    IE9,Opera:iframe1.contentWindow.document
      

  3.   

    建议你在子页面传值给父页面的的父页面方法来做A、父页
    B、子页
    C、子页的子页
    parent.functionName();
    但是你A、B父页必需要调用这个parent.functionName();方法.
      

  4.   

    var Iframe ;
    if(!!document.all)
            {
                Iframe = frames.document.frames('Iframe ');
              
            }
            else
            {
                Iframe = document.getElementById('Iframe ').contentWindow;
    }
    Iframe 就是你要获取的Iframe 对象Iframe.document.getElementById 获取 iframe 内的对象
      

  5.   

    document.getElementById('Iframe ').src 就可以