导航

firefox ie DOM 级兼容性(一)

Posted on 2008-09-11 16:21  龚振  阅读(461)  评论(0编辑  收藏  举报

为了让正在做的web文件上传在Firefox跑起来,目前正在改css和js,现将发现的部分问题记录下来,以备以后整理。

在firefox 和 ie 中,对于element:

ie有而firefox没有的属性:parentElement.

  1. parentElement
  2. ...

对previousSibling,nextSibling :

firefox 解释:

previousSibling:The node immediately preceding the given one in the tree, or null if there is no sibling node.

nextSibling :The node immediately following the given one in the tree, or null if there is no sibling node.

ie解释:

previousSibling:Retrieves a reference to the previous child of the parent for the object. 获取对此对象的上一个兄弟对象的引用。

nextSibling :Retrieves a reference to the next child of the parent for the object.获取对此对象的下一个兄弟对象的引用。

对于下面这段代码:

 

Code

 

在ie中对其中的document.getElementById("ID_Size").previousSibling或nextSibling 得到的都是tablecell;而在firefox中得到的是text类型(“\n         ”),在这个级别上,理解完全不一样。或者说,firefox 中的tree是只node级别,而ie中是element级别?

 

aaaaaaaaaa