日期:2014-05-16  浏览次数:20430 次

Document与document的区别 ?
在网上下了一段代码,据说是最好的Iframe自适应高度代码:
<iframe   src= "1.html "   name= "iframe "   id= "iframe "   allowtransparency= "true "   align= "default "   marginwidth= "0 "   marginheight= "0 "   frameborder= "0 "   scrolling= "no "   height= "200 "   width= "500 "   onload= "this.height=0;var   fdh=(this.Document?this.Document.body.scrollHeight:this.contentDocument.body.offsetHeight);this.height=(fdh> 200?fdh:200) "> This   message   is   only   visible   to   older   browsers. </iframe>  

有一个属性不理解:
"this.Document "为什么 "Document "的 "d "是大写,查了好多资料,没有关于这个解释,如果改成小写的 "document ",则出现错误!
请教各位大虾,Document与document区别是什么?
还有contentDocument是什么意思?

------解决方案--------------------
Document没见过,应该是document吧
contentDocument也没见过,是否是:
contentWindow 获取指定的 frame 或 iframe 的 window 对象。
------解决方案--------------------
是不是自定义的?枉自是多少啊,我也学习一下.
------解决方案--------------------
document 是 IE 下的 BOM 对象,根本没有 Document,其它浏览器应该也有!

alert(document); // [object]
alert(Document); // Error: 'Document ' 为定义

contentDocument 应该是非 IE 浏览器下的 BOM 对象!
------解决方案--------------------
iframe,这个比较怪,你用document.all.name取出来的是bom对象,document.getElementsByName()取出来的是dom对象,两个对象不相等