FrameA:alert(parent.FrameB.b)
FrameB:alert(parent.FrameA.document.all.a.value)

解决方案 »

  1.   

    惨啦,我也获取不了了!
    fason大哥看看:
    Untitled-4.htm:
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>无标题文档</title>
    </head>
    <body>
    <iframe id="inframe" src="Untitled-5.htm"></iframe>
    <script>
    alert(document.frames[0].document.all("txt").value);
    </script>
    </body>
    </html>Untitled-5.htm:
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>无标题文档</title>
    </head>
    <body>
    <form name="form1" method="post" action="">
      <input type="text" id="txt" name="textfield" value="aa">
    </form>
    </body>
    </html>
      

  2.   

    <script>
    function window.onload(){
    alert(document.frames[0].document.all("txt").value);
    //alert(document.frames[0].document.form1.txt.value);
    }
    </script>
      

  3.   

    应该是这样的:Untitled-4.htm:
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>无标题文档</title>
    </head>
    <body>
    <iframe id="inframe" src="Untitled-5.htm"></iframe>
    <script>
    alert(inframe.document.form1.textfield.value);
    </script>
    </body>
    </html>Untitled-5.htm:
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>无标题文档</title>
    </head>
    <body>
    <form name="form1" method="post" action="">
      <input type="text" id="txt" name="textfield" value="aa">
    </form>
    </body>
    </html>
      

  4.   

    to  zhjzh_zjz(虚心学习,望多指教):
    不知道你有没有试过呢?
    我试过是不行的。to  fason(【阿信】):
    你的方法行,但是能不能解释一下为什么我的方法和zhjzh_zjz(虚心学习,望多指教)的方法都不行呢,谢谢指教!
      

  5.   

    对了,我猜应该是inframe还没有load完对吧?