<iframe name="frameAccountInfo" src="frame.html" width="706" height="150" onload="yourfun()"></iframe>iframe里面还没下载完!

解决方案 »

  1.   

    实际上你只要弹出任何对话框都没有问题。主要是起个延时的作用。
    因为script被执行的时候frame还没有来得及加载呢。
      

  2.   

    改成这样子就没有问题了
    <HTML>
    </HEAD>
    <BODY onload=test()>
    <iframe name="frameAccountInfo" src="frame.html" width="706" height="150"></iframe>
    <script>  
    function test(){
    var acobj = document.frames.frameAccountInfo.document;
    //alert("acobj.all");
    alert(acobj.body.all.accountStat.value);   
    }
    </script>
    </BODY>
    </HTML>