the browser does not allow you to access the page content across domains, do it on the server side

解决方案 »

  1.   

    代码改成这样,访问文件所在域是可以的。<html><head>
    <title>新建网页 1</title>
    <script language="javascript">
       function disp()
       {
          var f = parent.document.forms[0];
          f.scode.value = I1.document.body.innerHTML;
       }
    </script>
    </head><body onLoad="disp();"><p><iframe id="I1"   src="C:\readme.htm" name="I1">
    浏览器不支持嵌入式框架,或被配置为不显示嵌入式框架。</iframe></p>
    <form method="POST">
      <p><textarea rows="16" name="scode" cols="69"></textarea></p>
    </form>
    </body></html>
      

  2.   

    var collAll = document.frames("l1").document.all