aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/window/document
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
commit33058f2b292b3a581333bdfb21b8f671898c5060 (patch)
tree51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/api/window/document
parent8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff)
downloadtranslated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip
initial commit
Diffstat (limited to 'files/zh-cn/web/api/window/document')
-rw-r--r--files/zh-cn/web/api/window/document/index.html67
1 files changed, 67 insertions, 0 deletions
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
+---
+<p>{{ ApiRef() }}</p>
+
+<p><span class="seoSummary"><strong><code>window.document</code></strong>返回当前窗口内的文档节点({{domxref("document")}})</span></p>
+
+<div class="note"><strong>注:</strong> {{ Fx_minversion_inline(3) }}从Firefox 3和IE7开始,访问其他页面内的文档节点会受到同源策略的影响.</div>
+
+<h2 id="Syntax" name="Syntax">语法</h2>
+
+<pre class="eval notranslate"><em>doc</em> = window.document
+</pre>
+
+<h2 id="Parameters" name="Parameters">参数</h2>
+
+<ul>
+ <li><code>doc</code>是一个指向{{domxref("document")}}对象的引用</li>
+</ul>
+
+<h2 id="Example" name="Example">例子</h2>
+
+<pre class="brush:html notranslate">&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+ &lt;title&gt;Hello, World!&lt;/title&gt;
+&lt;/head&gt;
+&lt;body&gt;
+
+&lt;script type="text/javascript"&gt;
+ var doc = window.document;
+ alert( doc.title); // 弹出: Hello, World!
+&lt;/script&gt;
+
+&lt;/body&gt;
+&lt;/html&gt;</pre>
+
+<h2 id="Specification" name="Specification">规范</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('HTML WHATWG', '#dom-document-2', 'Window.document')}}</td>
+ <td>{{Spec2('HTML WHATWG')}}</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>{{SpecName('HTML5 W3C', 'browsers.html#dom-document-0', 'Window.document')}}</td>
+ <td>{{Spec2('HTML5 W3C')}}</td>
+ <td></td>
+ </tr>
+ </tbody>
+</table>
+
+
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
+
+
+
+<p>{{Compat("api.Window.document")}}</p>