当前位置:网站首页>DOM简要
DOM简要
2022-07-06 10:20:00 【全栈程序员站长】
大家好,又见面了,我是全栈君。
在看Js视频的时候就感觉Dom这东西太奇妙了。在这个注重用户体验的Web设计时代里。Dom是至关重要的。
它的易用性强。而且遍历简单。支持XPath。
它既然这么强大那么就来简单的介绍Dom这个东东。
一、DOM是什么?
DOM即:文档对象模型(DocumentObject Model)。DOM就是一个编程接口。是针对HTML文档、XML等文档的一套API。就类似于JDBC是针对数据库的一套API一样。
二、DOM干什么?
DOM 是用来訪问或操作HTML文档、XHTML文档、XML文档中的节点元素。
如今基本上全部的浏览器都都运行了W3C公布的DOM规范,所以在浏览器上就能够用DOM的这些API。
三、什么时候用?
DOM实际上是一个操作文档里面所包括的内容的一个编程的API,开发者利用它从文档中读取、搜索、改动、添加和删除数据。
四、DOM具体说明
HTML文档是树状结构,根为<HTML>;DOM也是树状结构,根为window或document对象。所以DOM就能够把HTML以树状的形式呈现出来。
五、DOM的分类
核心 DOM:定义了一套标准的能够针对不论什么文档的对象。
HTML DOM:针对HTML文档的DOM。
XML DOM:针对XML文档的DOM。
六、DOM的级别Level
DOM0:不是W3C规范。
DOM1:開始是W3C规范。专注于HTML文档和XML文档。
DOM2:对DOM1添加了样式表对象模型
DOM3:对DOM2添加了内容模型 (DTD 、Schemas) 和文档验证。
七、DOM优缺点
DOM的优势:易用性强,使用DOM时,将把全部的XML文档信息都存于内存中。而且遍历简单,支持XPath。增强了易用性。
DOM的缺点:效率低,解析速度慢,内存占用量过高,对于大文件来说差点儿不可能使用。另外效率低还表如今大量的消耗时间,由于使用DOM进行解析时,将为文档的每一个element、attribute、processing-instrUCtion和comment都创建一个对象,这样在DOM机制中所运用的大量对象的创建和销毁无疑会影响其效率。
总结:
以上仅仅是对DOM基础知识的积累,让它在自己的头脑里有个头绪。至于它在代码中怎样实现,在今后的学习中会慢慢补充。
版权声明:本文博客原创文章,博客,未经同意,不得转载。
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/117406.html原文链接:https://javaforall.cn
边栏推荐
- Ms-tct: INRIA & SBU proposed a multi-scale time transformer for motion detection. The effect is SOTA! Open source! (CVPR2022)...
- C language college laboratory reservation registration system
- Comparative examples of C language pointers *p++, * (p++), * ++p, * (++p), (*p) + +, +(*p)
- FMT open source self driving instrument | FMT middleware: a high real-time distributed log module Mlog
- Maixll-Dock 摄像头使用
- ASEMI整流桥DB207的导通时间与参数选择
- 测试1234
- Jerry's watch deletes the existing dial file [chapter]
- Compilation Principle -- C language implementation of prediction table
- 高精度运算
猜你喜欢
Introduction to the usage of model view delegate principal-agent mechanism in QT
Appium automated test scroll and drag_ and_ Drop slides according to element position
Implementation of queue
Jerry is the custom background specified by the currently used dial enable [chapter]
Jerry's access to additional information on the dial [article]
[Android] kotlin code writing standardization document
Kivy tutorial: support Chinese in Kivy to build cross platform applications (tutorial includes source code)
虚拟机VirtualBox和Vagrant安装
UDP协议:因性善而简单,难免碰到“城会玩”
微信为什么使用 SQLite 保存聊天记录?
随机推荐
J'aimerais dire quelques mots de plus sur ce problème de communication...
Virtual machine VirtualBox and vagrant installation
Pourquoi Li shufu a - t - il construit son téléphone portable?
《ASP.NET Core 6框架揭秘》样章发布[200页/5章]
Scratch epidemic isolation and nucleic acid detection Analog Electronics Society graphical programming scratch grade examination level 3 true questions and answers analysis June 2022
阿里云国际版ECS云服务器无法登录宝塔面板控制台
Jerry is the custom background specified by the currently used dial enable [chapter]
C语言自动预订飞机票问题
2019阿里集群数据集使用总结
从交互模型中蒸馏知识!中科大&美团提出VIRT,兼具双塔模型的效率和交互模型的性能,在文本匹配上实现性能和效率的平衡!...
编译原理——自上而下分析与递归下降分析构造(笔记)
F200——搭载基于模型设计的国产开源飞控系统无人机
Nodejs developer roadmap 2022 zero foundation Learning Guide
Stealing others' vulnerability reports and selling them into sidelines, and the vulnerability reward platform gives rise to "insiders"
容器里用systemctl运行服务报错:Failed to get D-Bus connection: Operation not permitted(解决方法)
2022 Summer Project Training (III)
Grafana 9.0 正式发布!堪称最强!
MSF horizontal MSF port forwarding + routing table +socks5+proxychains
Cocos2d Lua 越来越小样本 内存游戏
面试突击62:group by 有哪些注意事项?