博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Document - Web API 接口参考 | MDN
阅读量:4097 次
发布时间:2019-05-25

本文共 2289 字,大约阅读时间需要 7 分钟。

接口表示任何在浏览器中载入的网页,并作为网页内容的入口,也就是。DOM 树包含了像table,body这样的元素,以及。它向网页文档本身提供了全局操作功能,能解决如何获取页面的 URL ,如何在文档中创建一个新的元素这样的问题。

Document 接口描述了任何类型的文档的通用属性与方法。根据不同的文档类型(例如、、,...),还能使用更多 API:使用 "text/html" 作为内容类型(content type)的 HTML 文档,还实现了  接口,而 XML 和 SVG 文档则(额外)实现了  接口

创建一个新的 Document 对象。

此接口也继承自  和  接口。

 只读

返回一个以文档节点为根节点的  集合。换句话说,它能返回页面的完整内容。

 只读

返回文档中所有锚点元素的列表。

返回当前文档的  或  节点。

 只读

返回文档正在使用的字符集。

 只读

指示文档是否以 quirks 怪异模式或 strict 严格模式呈现。

 只读

根据当前文档的 MIME Header,返回它的 Content-Type。

 只读

返回当前文档的文档类型定义(Document Type Definition, DTD)。

 只读

返回当前文档的直接子节点。对于 HTML 文档, 对象一般代表该文档的 元素。

 只读

以字符串的类型,返回当前文档的路径。

 只读

以列表(list)的类型,返回当前文档的嵌入式的元素  。

返回当前文档的  接口。

 只读

返回一个包含当前文档中所有表单元素  的列表。

 只读

返回当前文档的  元素。

 只读

返回一个布尔值,表明当前页面是否隐藏。

 只读

返回当前文档中所包含的图片的列表。

 只读

返回与当前文档相关联的 DOM 实现。

 只读

返回最后启用样式表的名字。在设置 前值都为 null 。 

 只读

返回一个包含文档中所有超链接的列表。

返回  ,仅当此文件是合成的(例如独立图像,视频,音频文件等)时才为 true 。

 只读

返回一个可用插件列表。

 只读

返回  interface which provides a simple API for introspecting the feature policies applied to a specific document.

 只读

返回 preferred style sheet set as specified by the page author.

 只读

返回文档中所有的  元素。

 只读

返回对文档  元素的引用。

返回当前正使用的样式表集。

 只读

返回文档上可用样式表的列表。

 只读

返回  的一个实例,该实例是在页面加载时自动创建的。

 只读

 只读

返回 string 表明当前文档的可见性。可能的取值有 visiblehiddenprerender, and unloaded 。

Document 接口继承自  的接口:

 Read only

Returns the number of children of this ParentNode which are elements.

 Read only

Returns a live  containing all of the  objects that are children of this ParentNode, omitting all of its non-element nodes.

 Read only

Returns the first node which is both a child of this ParentNode and is also an Element, or null if there is none.

 Read only

Returns the last node which is both a child of this ParentNode and is an Element, or null if there is none.

HTML 文件的 Document 接口继承自  接口(从 HTML5 扩展):

返回一个使用分号分隔的 cookie 列表,或设置(写入)一个 cookie。

 只读

返回一个对(当前) window 对象的引用。

获取或设置(让用户)编辑整个文档的能力。

 只读

获取或设置文档的文字方向(rtl 或 ltr)。

获取或设置当前文档的域名。

 只读

返回文档最后修改的时间。

 只读

返回当前文档的 URI。

 只读

返回当前文档的加载状态。

 只读

返回来源页面的 URI。

获取或设置当前文档的标题。

 只读

以字符串形式返回文档的地址栏链接。

Document 接口混入(mixin) 包含的属性。请注意,这些属性目前仅有 Chrome 实现;其他浏览器仍在  接口上直接实现它们。.

 只读

返回阴影树内聚焦的  。

 只读

当前文档处于全屏模式下的元素。

 只读

返回 element set as the target for mouse events while the pointer is locked. null if lock is pending, pointer is unlocked, or if the target is in another document.

 只读

Returns a  of  objects for stylesheets explicitly linked into, or embedded in a document.

转载地址:http://ddqii.baihongyu.com/

你可能感兴趣的文章
设计模式 依赖倒转原则 & 里氏代换原则
查看>>
DirectX11 光照
查看>>
图形学 图形渲染管线
查看>>
DirectX11 计时和动画
查看>>
DirectX11 光照与材质的相互作用
查看>>
DirectX11 环境光
查看>>
DirectX11 镜面光
查看>>
DirectX11 三种光照组成对比
查看>>
DirectX11 指定材质
查看>>
DirectX11 平行光
查看>>
DirectX11 点光
查看>>
DirectX11 聚光灯
查看>>
DirectX11 HLSL打包(packing)格式和“pad”变量的必要性
查看>>
DirectX11 光照演示示例Demo
查看>>
VUe+webpack构建单页router应用(一)
查看>>
Vue+webpack构建单页router应用(二)
查看>>
从头开始讲Node.js——异步与事件驱动
查看>>
Node.js-模块和包
查看>>
NodeJS开发指南——mongoDB、Session
查看>>
Express: Can’t set headers after they are sent.
查看>>