利用parent.parent 来一级一级向上引用父层的内容

解决方案 »

  1.   

    window.top.document.getElementById("obj")......
      

  2.   

      这个用不上啊,要调用最顶层的javascript里面的对象.  例如Array对象。
      

  3.   

    ??
    var arr=new Array();主页面
    window.top.arr[..]不就可以拿到了吗?
      

  4.   

       if( window.top != null)
       {
            userInfo = window.top.userInfo;
       } 取不到.
      

  5.   

    这个是我做的试验是可以取到值的
    a主页面
    <html >
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title></title>
    <script>
    var ab= new Array(10);
    ab[0]=0;
    ab[1]=1;
    </script>
    </head><body>
    <iframe id="a" src="b.html"  style="width:200; height:200"></iframe>
    </body>
    </html>b是a的子页面<html>
     <head>
      <title> New Document </title> </head> <body>  <iframe id="b" src="c.html" style="width:200; height:200"></iframe>
     </body>
    </html>
    c是b的子页面
    <html >
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>c</title>
    <script>
    function test()
    {
        if(window.top!=null)
    {
      var s=window.top.ab;
      alert(s)
    }
    }
    </script>
    </head><body>
    <input type="button" onclick="test()" />
    </body>
    </html>
      

  6.   

        thanks 最近刚从C/S转B/S开发.被这javascript搞的真够郁闷的。