javascript - dom2 和 dom3
2017-07-25 14:53
274 查看
dom2级和3级的目的在于扩展domapi, 满足操作xml的需求, 同时提供更好的错误处理及特性检测能力
dom的变化:
node类型的变化:
dom2级的变化:
localName: 不带命名空间前缀的节点名称
namespaceURI: 命名空间uri或者在未指定的情况下是null
prefix: 命名空间前缀或者在未指定的情况下是null
dom3级的变化:
isDefaultNamespace(namespaceURI): 在指定的namespaceuri是当前节点的默认命名空间的情况下返回true
lookupNamespaceURI(prefix): 返回给定的prefix的命名空间
lookupPrefix(namespaceURI): 返回给定的namespaceURI的前缀
document的变化:
createElementNS(namespaceURI, tagName): 使用给定的tagname创建一个属于命名空间的新元素
createAttributeNS(namespaceURI, attribute)
getElementsByTagNameNS(namespaceURI, tagname): 返回指定tagename下的命名空间的nodelist
element的变化:
getAttributeNS(namespaceURI, localname_):
getAttributeNodeNS()
hasAttributeNS();
removeAttributeNS();
-
NodeNameMap的变化:
dom的变化:
node类型的变化:
dom2级的变化:
localName: 不带命名空间前缀的节点名称
namespaceURI: 命名空间uri或者在未指定的情况下是null
prefix: 命名空间前缀或者在未指定的情况下是null
dom3级的变化:
isDefaultNamespace(namespaceURI): 在指定的namespaceuri是当前节点的默认命名空间的情况下返回true
lookupNamespaceURI(prefix): 返回给定的prefix的命名空间
lookupPrefix(namespaceURI): 返回给定的namespaceURI的前缀
document的变化:
createElementNS(namespaceURI, tagName): 使用给定的tagname创建一个属于命名空间的新元素
createAttributeNS(namespaceURI, attribute)
getElementsByTagNameNS(namespaceURI, tagname): 返回指定tagename下的命名空间的nodelist
element的变化:
getAttributeNS(namespaceURI, localname_):
getAttributeNodeNS()
hasAttributeNS();
removeAttributeNS();
-
NodeNameMap的变化:
//dom的变化 <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>example xhtml page</title> </head> <body> <s:svg xmlns:s="http://www.w3.org/1999/html"></s:svg> </body> </html> //对于html元素来说: loaclname:html, namespaceUrI: http://www.w3.org/1999/xhtml, prefix: null //对于s:svg元素来说: localname: svg, namespaceUrI: http://www.w3.org/1999/xhtml, prefix: s
相关文章推荐
- JavaScript高级程序设计之DOM2和DOM3之样式之元素大小第12.2.3讲
- JavaScript学习-DOM2和DOM3的变化
- JavaScript笔记:DOM2 & DOM3
- JavaScript高级程序设计之DOM2和DOM3之样式之访问元素的样式第12.2.1讲
- JavaScript高级程序设计10--DOM2和DOM3
- JavaScript高级程序设计之DOM2和DOM3之DOM 变化之针对XML命名空间的变化第12.1.1讲
- JavaScript DOM高级程序设计 3.-DOM2和HTML2--我要坚持到底!
- JavaScript高级程序设计之DOM2和DOM3之DOM 变化之其他方面的变化第12.1.2讲
- JavaScript基础——DOM2和DOM3
- Javascript学习笔记7 DOM2和DOM3
- [知了堂学习笔记] javascript DOM学习
- javascript 中的dom
- javascript中关于DOM的代码示例及相关笔记
- 轻松学习JavaScript二十三:DOM编程学习之操作表格
- position属性absolute与relative 详解 最近一直在研究javascript脚本,熟悉DOM中CSS样式的各种定位属性,以前对这个属性不太了解,从网上找到两篇文章感觉讲得很透彻,
- Javascript 获取dom的宽度 随笔一
- JavaScript基本概念—DOM(1)
- JavaScript进阶之DOM
- 《JavaScript_DOM编程艺术第二版(中文)》整书笔记
- javascript;Dom相关笔记