From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../zh-cn/web/api/document_object_model/index.html | 411 +++++++++++++++++++++ 1 file changed, 411 insertions(+) create mode 100644 files/zh-cn/web/api/document_object_model/index.html (limited to 'files/zh-cn/web/api/document_object_model/index.html') diff --git a/files/zh-cn/web/api/document_object_model/index.html b/files/zh-cn/web/api/document_object_model/index.html new file mode 100644 index 0000000000..656ca763f8 --- /dev/null +++ b/files/zh-cn/web/api/document_object_model/index.html @@ -0,0 +1,411 @@ +--- +title: 文档对象模型 (DOM) +slug: Web/API/Document_Object_Model +tags: + - API + - DOM + - DOM 参考文档 + - 中级 +translation_of: Web/API/Document_Object_Model +--- +

{{DefaultAPISidebar("DOM")}}

+ +

文档对象模型 (DOM) 将 web 页面与到脚本或编程语言连接起来。通常是指  JavaScript,但将 HTML、SVG 或 XML 文档建模为对象并不是 JavaScript 语言的一部分。DOM模型用一个逻辑树来表示一个文档,树的每个分支的终点都是一个节点(node),每个节点都包含着对象(objects)。DOM的方法(methods)让你可以用特定方式操作这个树,用这些方法你可以改变文档的结构、样式或者内容。节点可以关联上事件处理器,一旦某一事件被触发了,那些事件处理器就会被执行。

+ +

这里还有一篇关于DOM的 介绍 。

+ +

DOM 接口

+ +
+ +
+ +

过时的 DOM 接口

+ +

DOM模型已经被高度简化了。为此,以下出现在DOM level 3或更早的规范里的接口已经被移除了。  现在不是非常确定是否有一些会被重新引进,但是当前应该把它们看作废弃的,应当避免使用:

+ +
+ +
+ +

HTML 接口

+ +

{{domxref("HTMLDocument")}} 接口描述了包含 HTML 的文档。注意:HTML 规范也继承了{{domxref("Document")}} 接口。

+ +

一个 HTMLDocument 对象还可以访问浏览器的各种功能:例如使用 {{domxref("Window")}} 接口来绘制的标签或窗口,与之关联的样式 {{domxref("window.style", "Style")}}(通常是CSS),浏览器相对于上下文的历史记录 {{domxref("window.history", "History")}},以及文档内的选区 {{domxref("Selection")}} 等。

+ +

HTML 元素接口

+ +
+ +
+ +

其他接口

+ +
+ +
+ +

过时的 HTML 接口

+ +
+ +
+ +

SVG 接口

+ +

SVG 元素接口

+ +
+ +
+ +

SVG 数据类型接口

+ +

Here are the DOM API for data types used in the definitions of SVG properties and attributes.

+ +
+

注意: Starting in {{Gecko("5.0")}},the following SVG-related DOM interfaces representing lists of objects are now indexable and can be accessed like arrays; in addition, they have a length property indicating the number of items in the lists: {{domxref("SVGLengthList")}}, {{domxref("SVGNumberList")}}, {{domxref("SVGPathSegList")}}, and {{domxref("SVGPointList")}}.

+
+ +

Static type

+ +
+ +
+ +

Animated type

+ +
+ +
+ +

SVG 路径段接口

+ +
+ +
+ +

SMIL 相关接口

+ +
+ +
+ +

其他的 SVG 接口

+ +
+ +
+ +

相关参考

+ + -- cgit v1.2.3-54-g00ecf