DOM  ==  document object model
 
document 对象是唯一同时属于  BOM 和 DOM  的

 
rows 是一种DOM集合,不是数组,所以没有sort() 函数。
 
NodeList   NamedNodeMap :
 
 
document.all  ==  document.getElementByTagName("*");   取得document中所有元素
 
ie6 在使用getElementByName() 和 getElementById() 时都会同时匹配 id 和 name 属性,要注意
 
ie 在使用 setAttribute()  有可能出错
所以尽可能使用  img.src 形式取代 img.getAttribute("src")   
 
Dom对象是host object,host 对象在ie8以及之前版本是通过COM实现的,而不是JScript
所以document.createElement 等Dom 方法是COM 对象的实例,因此typeof document.createElement 返回 object
 
每一个node节点都有自己的ownerDocument属性,如果将不同ownerDocument属性append到结构中会产生错误,需要使用importNode()方法。
 
注意直接定义在node上的属性,在标准浏览器和ie9,10中用getAttribute取不到,得到的结果是null
比如div.aa = 10,用div.getAttribute('aa')得到的是null,需要用div.aa或者div['aa']这样来取
 
 
 
Nodelist是类数组对象,但不是Array的实例( 转化为数组的话[].slice.call(eleList) ),当然用不了array的方法啦,同时它是动态更新的,实时变化的
function convertToArray(nodes)  {
    var array = null;
    try {
        array = Array.prototype.slice.call(nodes, 0); //non-IE and IE9+,throw an error because a NodeList is implemented as a COM object and thus cannot be used where a JScript object is necessary
    } 
    catch (ex)  {
        array = new Array();
        for (var i=0, len=nodes.length; i < len; i++)  {
            array.push(nodes[i]); 
        } 
    }
    return array; 
}
 
 
Dom把页面转化为层次节点结构的地图
Html或者xml的每一个部分都是一种包含不同数据的节点
通过这种树状结构来表示document,可以让开发者获得节点中的内容和修改它的结构
 
DOM Level 1 became a W3C recommendation in October 1998. It consisted of two modules(Dom core and Dom HTML interface):
the DOM Core, which provided a way to map the structure of an XML-based document to allow for easy access to and manipulation of any part of a document, and the DOM HTML, which extended the DOM Core by adding HTML-specific objects and methods.
 
Dom 2 added support for mouse and user-interface events (long supported by DHTML), ranges, traversals (methods to iterate over a DOM document), and support for Cascading Style Sheets (CSS) through object interfaces. The original DOM Core introduced in Level 1 was also extended to include support for XML namespaces.
 
- ➤ DOM Views — Describes interfaces to keep track of the various views of a document (the document before and after CSS styling, for example)
 
- ➤ DOM Events — Describes interfaces for events and event handling
 
- ➤ DOM Style — Describes interfaces to deal with CSS-based styling of elements
 
- ➤ DOM Traversal and Range — Describes interfaces to traverse and manipulate a document tree
 
 
DOM Level 3 further extends the DOM with the introduction of methods to load and save documents in a uniform way (contained in a new module called DOM Load and Save) and methods to validate a document (DOM Validation). In Level 3, the DOM Core is extended to support all of XML 1.0, including XML Infoset, XPath, and XML Base.
 

DOM 对象的更多相关文章

  1. HTML DOM 对象

    本篇主要介绍HTML DOM 对象:Document.Element.Attr.Event等4个对象. 目录 1. Document 对象:表示文档树的根节点,大部分属性和方法都是对元素进行操作. 2 ...

  2. JavaScript实现DOM对象选择器

    目的: 根据传入的选择器类型选出第一个符合的DOM对象. ①可以通过id获取DOM对象,例如 $("#adom"); ②可以通过tagName获取DOM对象,例如 $(" ...

  3. 判断一个对象是jQuery对象还是DOM对象

    今天调试一段代码的时候,看到其中一个变量,想知道它到底是jquery对象还是dom对象. 虽然直接console出这个对象,看它的内部可以判断出来.但是我想有没有什么更方便的方法呢. 后来我想到了一个 ...

  4. 如何通过源生js获取一个元素的具体样式值 /* getCss:获取指定元素的具体样式的属性值 curElement:[dom对象] attr:[string] */

    昨天的博客些的真的是惨不忍睹啊!!!但是我的人生宗旨就是将不要脸的精神进行到底,所以,今天我又来了.哈哈哈哈哈! 方法一:元素.style.属性名:(这个有局限性--只能获取行内样式的值,对于样式表或 ...

  5. 锋利的jQuery--jQuery与DOM对象的互相转换,DOM的三种操作(读书笔记一)

    1.jQuery对象就是通过jQuery包装DOM对象后产生的对象.   2.jQuery对象和DOM对象的相互转换.   良好的书写风格: var $input=$("input" ...

  6. jQuery对象和DOM对象的区别

    jQuery对象和DOM对象使用说明,需要的朋友可以参考下.1.jQuery对象和DOM对象第一次学习jQuery,经常分辨不清哪些是jQuery对象,哪些是 DOM对象,因此需要重点了解jQuery ...

  7. DOM对象与jQuery对象的相互转换

    DOM  对象可以使用 js       中的方法,  不能使用jQuery中的方法:jQuery对象只能使用jQuery中的方法, 不能使用js中的方法:jQuery对象是通过jQuery包装DOM ...

  8. DOM对象—选中执行效果

    ---恢复内容开始--- 例如我们注册时,一些法律条例,我们是否同意决定着能否注册.在选择同意或不同意时出现的效果. 先在body里做一个按钮和选项框. <input type="ch ...

  9. jQuery对象与dom对象相互转换

    核心提示:jquery选择器得到的jquery对象和标准的 javascript中的document.getElementById()取得的dom对象是两种不同的对象类型,一般情况下,如S('#id' ...

  10. 关于DOM对象与JQuery对象的那些事

    这个问题源自上一次的工作室讨论班,主题是"jQuery选择器的使用",在讨论班的结尾,我留了一个思考题:  jQuery获取到的对象和直接调用原生Javascript方法获得的对象 ...

随机推荐

  1. PLT文件 和 DXF文件

    PLT: CAM/CAD类似软件处理的图像文件的文件格式 DXF: AutoCAD(Drawing Interchange Format或者Drawing Exchange Format) 绘图交换文 ...

  2. .NET十年回顾

    一.   引子 从我还是编程菜鸟时起,.NET就从来没让我失望过.总是惊喜不断. 当年我第一个项目是做个进销存.用的Winform.当时我是机电工程师.编程只是业余心血来潮而已. .NET的低门槛.V ...

  3. uva11401

    题目大意:计算从1,2,3,...,n中选出3个不同的整数,使得以它们为边长可以构成三角形的个数. 思路:用一般的方法需要三重循环,时间复杂度为O(n^3),肯定超时,因此可用数学的方法对问题进行分析 ...

  4. 自测-5 Shuffling Machine

    Shuffling is a procedure used to randomize a deck of playing cards. Because standard shuffling techn ...

  5. Elasticsearch 数据搜索

    ES即简单又复杂,你可以快速的实现全文检索,又需要了解复杂的REST API.本篇就通过一些简单的搜索命令,帮助你理解ES的相关应用.虽然不能让你理解ES的原理设计,但是可以帮助你理解ES,探寻更多的 ...

  6. zoj 1884 简单 键盘 字符 处理

    WERTYU Time Limit: 2 Seconds      Memory Limit: 65536 KB A common typing error is to place the hands ...

  7. java web jsp原理图 ,静态包含,动态包含,out与response.getWrite()

    jsp原理图 ,静态包含,动态包含,out与response.getWrite() 

  8. cocos2dx - 创建地图及玩家(伪)

    接上一节内容:cocos2dx - 环境配置,项目创建 本节主要描述cocos中精灵的创建及点击事件的使用 打开创建好的test项目,看到下图的目录结构,真正的游戏逻辑路径在src下. AppDele ...

  9. 多线程(RunLoop)

    1.RunLoop的概念及作用 2.RunLoop的使用 3.RunLoop的相关类 4.RunLoop的工作原理 5.小结 6.思考 什么是RunLoop? 从字面意思上是一直循环跑,事实上就是一个 ...

  10. $http设置headers来实现IE不缓存url请求的资源

    var getOrders = function(){    var deferred = $q.defer();    $http({    method:'get',    url:'/getOr ...