From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/zh-cn/web/api/window/document/index.html | 67 ++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 files/zh-cn/web/api/window/document/index.html (limited to 'files/zh-cn/web/api/window/document') diff --git a/files/zh-cn/web/api/window/document/index.html b/files/zh-cn/web/api/window/document/index.html new file mode 100644 index 0000000000..04258782b7 --- /dev/null +++ b/files/zh-cn/web/api/window/document/index.html @@ -0,0 +1,67 @@ +--- +title: window.document +slug: Web/API/Window/document +translation_of: Web/API/Window/document +--- +

{{ ApiRef() }}

+ +

window.document返回当前窗口内的文档节点({{domxref("document")}})

+ +
注: {{ Fx_minversion_inline(3) }}从Firefox 3和IE7开始,访问其他页面内的文档节点会受到同源策略的影响.
+ +

语法

+ +
doc = window.document
+
+ +

参数

+ + + +

例子

+ +
<!DOCTYPE html>
+<html>
+<head>
+   <title>Hello, World!</title>
+</head>
+<body>
+
+<script type="text/javascript">
+   var doc = window.document;
+   alert( doc.title);    // 弹出: Hello, World!
+</script>
+
+</body>
+</html>
+ +

规范

+ + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#dom-document-2', 'Window.document')}}{{Spec2('HTML WHATWG')}}
{{SpecName('HTML5 W3C', 'browsers.html#dom-document-0', 'Window.document')}}{{Spec2('HTML5 W3C')}}
+ + +

浏览器兼容性

+ + + +

{{Compat("api.Window.document")}}

-- cgit v1.2.3-54-g00ecf