Document没见过,应该是document吧
contentDocument也没见过,是否是:
contentWindow 获取指定的 frame 或 iframe 的 window 对象。

解决方案 »

  1.   

    Document,contentDocument 就是这2个属性,如果改成其他的,比如像你说的那样,效果会出问题,我都改过了,只有这两个属性才是正确的。
      

  2.   

    document 是 IE 下的 BOM 对象,根本没有 Document,其它浏览器应该也有!alert(document); // [object]
    alert(Document); // Error: 'Document' 为定义contentDocument 应该是非 IE 浏览器下的 BOM 对象!
      

  3.   

    作了一个测试 :
    test.htm
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>test.htm</title>
    </head><body>
    <iframe src="1.htm" onload="alert(this.Document.title)"></iframe>
    <iframe src="1.htm" onload="alert(this.document.title)"></iframe>
    </body>
    </html>1.htm
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>1.htm</title>
    </head><body>
    </body>
    </html>this.document.title = test.htm
    this.Document.title = 1.htm
      

  4.   

    iframe,这个比较怪,你用document.all.name取出来的是bom对象,document.getElementsByName()取出来的是dom对象,两个对象不相等