27.Node的childNodes属性的值是一个NodeList Object,该对象的行为类似于Node Object的数组
28.操作DOM时有一个基本的规则:在文档树加载解析完成之前,不能对其进行遍历或者操作。SAX不是这样的
29.Node接口除了定义了childNodes属性外,还定义了其他几个方便的属性,包括firstChild,lastChild,nextSibling,previousSibling
30.每个DOM tree的根节点都是Document Object(文档对象,在客户端javascript里就是window.document),但它并不代表树里的某一个HTML元素。document.documentElement属性指向<html>标签,它作为文档的根元素
31.document.getElementsByTagName()方法,根据tag名称获取ElementNode的数组集合,然后用下标访问
var tables = document.getElementsByTagName("table");
alert("This document contains " + tables.length + " tables");
注意,getElementsByTagName的返回结果是不区分大小写的,传递的参数也是
32.document.getElementById()方法,是根据id attribute获取Element,只会返回一个结果
33.除了Document Object之外Element Object也有getElementsByTagName方法,用法和document的同名方法一样,区别在于它只搜索调用元素的子元素,不会遍历整个DOM tree
34.document.getElementsByName()方法是根据name attribute查询,返回结果是一个数组
35.可以用setAttribute()方法设置元素的attribute,也可以直接赋值的方式来设置,2者的效果是一样的
36.DocumentFragment是一种特殊的节点类型,它本身不出现在文档中,而是作为节点集合的临时容器存在,并且能够把这些节点集合看做一个单独的对象进行操作。当把一个DocumentFragment插入文档时,并不是其自身被插入,而是它所有的子节点被插入,之后DocumentFragment就被清空,并且不能再次使用,除非重新向其中加入子节点
分享到:
相关推荐
IronPython.dll和Microsoft.Scripting.dll,用于C#动态调用 IronPython
( [Classic.Shell.Scripting(第1版)].(Classic.Shell.Scripting).Arnold.Robbins.文字版.epub )
Game.Scripting.Mastery 游戏脚本高级编程英文版,中文版翻译烂了点
powershell Introduction to programming grammar, specifications, cases, etc., introductory books for beginners
Packtpub.Blender.2.49.Scripting.Apr.2010.rar
Microsoft.Press.Windows.PowerShell.Scripting.Guide.Feb.2008
FriendsofED.DOM.Scripting.Dec.2010.rar
Wrox.Shell.Scripting.Aug.2011.rar
Blueprints.Visual.Scripting.for.Unreal.Engine.2015虚幻引擎蓝图教程
Python Scripting for ArcGIS is a guide for experienced users of ArcGIS Desktop to get started with Python scripting without needing previous programming experience. Experience with other scripting or ...
Maya.3D.-.Mel.Scripting maya 脚本语言的入门教程,很适合初学者。
Python.Scripting.for.Computational.Science.3rd.Edition.pdf
游戏脚本设计完全掌握-Game.Scripting.Mastery.part2.rar
AdvancED.DOM.Scripting.Jul.2007.pdf
UNIX.Oracle.Shell.Scripting
Shell Scripting Recipes, 2nd Edition is ...Chapter 15: Random Acts of Scripting Chapter 16: A Smorgasbord of Scripts Chapter 17: Script Development Management Appendix: Internet Scripting Resources
Packt.Unity.Game.Development.Scripting.2014
Apress.DOM.Scripting.Web.Design.with.JavaScript.and.the.Document.Object.Model.2nd.Edition
Apress.Practical.JavaScript.DOM.Scripting.and.Ajax.Projects
Springer.Scientific.Data.Analysis.using.Jython.Scripting.and.Java