aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/document/close
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/document/close
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/document/close')
-rw-r--r--files/zh-cn/web/api/document/close/index.html59
1 files changed, 59 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/document/close/index.html b/files/zh-cn/web/api/document/close/index.html
new file mode 100644
index 0000000000..f1356e5b57
--- /dev/null
+++ b/files/zh-cn/web/api/document/close/index.html
@@ -0,0 +1,59 @@
+---
+title: Document.close()
+slug: Web/API/Document/close
+tags:
+ - API
+ - Document
+ - 参考
+ - 方法
+translation_of: Web/API/Document/close
+---
+<div>{{APIRef("DOM")}}</div>
+
+<p><strong><code>Document.close()</code></strong> 用于结束由 对文档的 {{domxref("Document.write()")}} 写入操作,这种写入操作一般由 {{domxref("Document.open()")}} 打开。</p>
+
+<h2 id="语法">语法</h2>
+
+<pre class="syntaxbox">document.close();</pre>
+
+<h2 id="例子">例子</h2>
+
+<pre>// 打开一个文档,以便写入数据
+document.open();
+
+// 写入文档内容
+document.write("&lt;p&gt;文档内容~&lt;/p&gt;");
+
+// 关闭文档
+document.close();
+</pre>
+
+<h2 id="规范">规范</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">规范</th>
+ <th scope="col">状态</th>
+ <th scope="col">备注</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{SpecName("HTML WHATWG", "#dom-document-close", "document.close()")}}</td>
+ <td>{{Spec2("HTML WHATWG")}}</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>{{SpecName("DOM2 HTML", "html.html#ID-98948567", "document.close()")}}</td>
+ <td>{{Spec2("DOM2 HTML")}}</td>
+ <td></td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
+
+
+
+<p>{{Compat("api.Document.close")}}</p>