aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/document
diff options
context:
space:
mode:
Diffstat (limited to 'files/zh-cn/web/api/document')
-rw-r--r--files/zh-cn/web/api/document/createelement/index.html2
-rw-r--r--files/zh-cn/web/api/document/createevent/index.html2
-rw-r--r--files/zh-cn/web/api/document/createnodeiterator/index.html4
-rw-r--r--files/zh-cn/web/api/document/execcommand/index.html2
-rw-r--r--files/zh-cn/web/api/document/keypress_event/index.html5
-rw-r--r--files/zh-cn/web/api/document/queryselector/index.html2
-rw-r--r--files/zh-cn/web/api/document/queryselectorall/index.html6
-rw-r--r--files/zh-cn/web/api/document/title/index.html2
8 files changed, 10 insertions, 15 deletions
diff --git a/files/zh-cn/web/api/document/createelement/index.html b/files/zh-cn/web/api/document/createelement/index.html
index a0b1fecfad..e45a93dac1 100644
--- a/files/zh-cn/web/api/document/createelement/index.html
+++ b/files/zh-cn/web/api/document/createelement/index.html
@@ -24,7 +24,7 @@ translation_of: Web/API/Document/createElement
<dt><var>tagName</var></dt>
<dd>指定要创建元素类型的字符串,创建元素时的 {{domxref("Node.nodeName", "nodeName")}} 使用 <code>tagName</code> 的值为初始化,该方法不允许使用限定名称(如:"html:a"),在 HTML 文档上调用 <code>createElement()</code> 方法创建元素之前会将<code>tagName</code> 转化成小写,在 Firefox、Opera 和 Chrome 内核中,<code>createElement(null)</code> 等同于 <code>createElement("null")</code></dd>
<dt><var>options</var>{{optional_inline}}</dt>
- <dd>一个可选的参数 <code>ElementCreationOptions</code> 是包含一个属性名为 <code>is</code> 的对象,该对象的值是用 <code>customElements.define()</code> 方法定义过的一个自定义元素的标签名。为了向前兼容较老版本的 <a href="https://www.w3.org/TR/custom-elements/">Custom Elements specification</a>, 有一些浏览器会允许你传一个值为自定义元素的标签名的字符串作为该参数的值。可以参考本页下方的 {{anch("Web component example")}} Google 的 <a href="https://developers.google.com/web/fundamentals/primers/customelements/#extendhtml">Extending native HTML elements</a> 文档仔细了解如何使用该参数。</dd>
+ <dd>一个可选的参数 <code>ElementCreationOptions</code> 是包含一个属性名为 <code>is</code> 的对象,该对象的值是用 <code>customElements.define()</code> 方法定义过的一个自定义元素的标签名。为了向前兼容较老版本的 <a href="https://www.w3.org/TR/custom-elements/">Custom Elements specification</a>, 有一些浏览器会允许你传一个值为自定义元素的标签名的字符串作为该参数的值。可以参考本页下方的 <a href="#web_component_示例">Web component 示例</a> Google 的 <a href="https://developers.google.com/web/fundamentals/primers/customelements/#extendhtml">Extending native HTML elements</a> 文档仔细了解如何使用该参数。</dd>
</dl>
<h3 id="返回值">返回值</h3>
diff --git a/files/zh-cn/web/api/document/createevent/index.html b/files/zh-cn/web/api/document/createevent/index.html
index d371052ddc..efcd7e1288 100644
--- a/files/zh-cn/web/api/document/createevent/index.html
+++ b/files/zh-cn/web/api/document/createevent/index.html
@@ -20,7 +20,7 @@ translation_of: Web/API/Document/createEvent
<ul>
<li><code>event</code> 就是被创建的 <a href="/zh-CN/docs/DOM/event" title="DOM/event">Event</a> 对象.</li>
- <li><code>type</code> 是一个字符串,表示要创建的事件类型。事件类型可能包括<code>"UIEvents"</code>, <code>"MouseEvents"</code>, <code>"MutationEvents"</code>, 或者 <code>"HTMLEvents"</code>。请查看 {{Anch("Notes")}} 章节获取详细信息 。</li>
+ <li><code>type</code> 是一个字符串,表示要创建的事件类型。事件类型可能包括<code>"UIEvents"</code>, <code>"MouseEvents"</code>, <code>"MutationEvents"</code>, 或者 <code>"HTMLEvents"</code>。请查看 <a href="#notes">Notes</a> 章节获取详细信息 。</li>
</ul>
<h2 id="Example" name="Example">示例</h2>
diff --git a/files/zh-cn/web/api/document/createnodeiterator/index.html b/files/zh-cn/web/api/document/createnodeiterator/index.html
index 1e1b653d7a..139c554ef1 100644
--- a/files/zh-cn/web/api/document/createnodeiterator/index.html
+++ b/files/zh-cn/web/api/document/createnodeiterator/index.html
@@ -98,12 +98,12 @@ translation_of: Web/API/Document/createNodeIterator
</table>
</dd>
<dt><code>filter</code> {{ optional_inline() }}</dt>
- <dd>是实现 {{ domxref("NodeFilter") }} 接口的对象; 其 <code>acceptNode()</code> 方法会对从根节点开始到子树中的每个节点都调用一次,哪些节点需要进入迭代节点列表等待调用则取决于whatToShow参数(也可以使用一个简单的回调函数代替<code>acceptNode()</code>)。该方法需要返回下列常量之一: <code>NodeFilter.FILTER_ACCEPT</code> ,<code>NodeFilter.FILTER_REJECT</code> 或 <code>NodeFilter.FILTER_SKIP</code>(见<a href="https://developer.mozilla.org/zh-CN/docs/Web/API/NodeFilter">NodeFilter</a>),参见{{ anch("示例") }}。</dd>
+ <dd>是实现 {{ domxref("NodeFilter") }} 接口的对象; 其 <code>acceptNode()</code> 方法会对从根节点开始到子树中的每个节点都调用一次,哪些节点需要进入迭代节点列表等待调用则取决于whatToShow参数(也可以使用一个简单的回调函数代替<code>acceptNode()</code>)。该方法需要返回下列常量之一: <code>NodeFilter.FILTER_ACCEPT</code> ,<code>NodeFilter.FILTER_REJECT</code> 或 <code>NodeFilter.FILTER_SKIP</code>(见<a href="https://developer.mozilla.org/zh-CN/docs/Web/API/NodeFilter">NodeFilter</a>),参见<a href="#示例">示例</a>。</dd>
</dl>
<div class="note"><strong>注意: </strong>在Gecko12.0{{ geckoRelease("12.0") }}以前,这个方法接收第四个可选的参数(<code>entityReferenceExpansion</code>),这不是DOM4 规范中的一部分,因此被移除了。这个参数表示实体引用节点的子代对于迭代器是否可见。因为浏览器不会创建这样的节点,这个参数没有任何作用。</div>
-<h2 id="Example" name="Example">示例</h2>
+<h2 id="示例">示例</h2>
<pre>const nodeIterator = document.createNodeIterator(
    document.body,
diff --git a/files/zh-cn/web/api/document/execcommand/index.html b/files/zh-cn/web/api/document/execcommand/index.html
index 355a4bd33f..cf51a9be23 100644
--- a/files/zh-cn/web/api/document/execcommand/index.html
+++ b/files/zh-cn/web/api/document/execcommand/index.html
@@ -31,7 +31,7 @@ translation_of: Web/API/Document/execCommand
<dl>
<dt><code>aCommandName</code></dt>
- <dd>一个 {{domxref("DOMString")}} ,命令的名称。可用命令列表请参阅 {{anch("命令")}} 。</dd>
+ <dd>一个 {{domxref("DOMString")}} ,命令的名称。可用命令列表请参阅 <a href="#命令">命令</a> 。</dd>
<dt><code>aShowDefaultUI</code></dt>
<dd>一个 {{jsxref("Boolean")}}, 是否展示用户界面,一般为 false。Mozilla 没有实现。</dd>
<dt><code>aValueArgument</code></dt>
diff --git a/files/zh-cn/web/api/document/keypress_event/index.html b/files/zh-cn/web/api/document/keypress_event/index.html
index 297a595b2b..a9c2bf2bf3 100644
--- a/files/zh-cn/web/api/document/keypress_event/index.html
+++ b/files/zh-cn/web/api/document/keypress_event/index.html
@@ -78,7 +78,7 @@ translation_of: Web/API/Document/keypress_event
<tr>
<td><code>key</code> {{readonlyInline}}</td>
<td>DOMString (string)</td>
- <td>The key value of the key represented by the event. If the value has a printed representation, this attribute's value is the same as the <code>char</code> attribute. Otherwise, it's one of the key value strings specified in {{ anch("Key values") }}. If the key can't be identified, this is the string "Unidentified". See <a href="/en-US/docs/Web/API/KeyboardEvent#Key_names_and_Char_values">key names and char values</a> for the detail. Read Only.</td>
+ <td>The key value of the key represented by the event. If the value has a printed representation, this attribute's value is the same as the <code>char</code> attribute. Otherwise, it's one of the key value strings specified in <a href="#key_values">Key Values</a>. If the key can't be identified, this is the string "Unidentified". See <a href="/en-US/docs/Web/API/KeyboardEvent#Key_names_and_Char_values">key names and char values</a> for the detail. Read Only.</td>
</tr>
<tr>
<td><code>charCode</code> {{readonlyInline}}</td>
@@ -90,7 +90,7 @@ translation_of: Web/API/Document/keypress_event
<tr>
<td><code>keyCode</code> {{readonlyInline}}</td>
<td>Unsigned long (int)</td>
- <td>A system and implementation dependent numerical code identifying the unmodified value of the pressed key. This is usually the decimal ASCII ({{ RFC(20) }}) or Windows 1252 code corresponding to the key; see {{ anch("Virtual key codes") }} for a list of common values. If the key can't be identified, this value is 0.
+ <td>A system and implementation dependent numerical code identifying the unmodified value of the pressed key. This is usually the decimal ASCII ({{ RFC(20) }}) or Windows 1252 code corresponding to the key; see <a href="virtual_key_codes">Virtual key codes</a> for a list of common values. If the key can't be identified, this value is 0.
<div class="warning"><strong>Warning:</strong> This attribute is deprecated; you should use <code>key</code> instead, if available.</div>
</td>
</tr>
@@ -137,7 +137,6 @@ translation_of: Web/API/Document/keypress_event
<td><code>true</code> if the meta key was down when the event was fired. <code>false</code> otherwise.</td>
</tr>
</tbody>
-</table>
<h2 id="Related_Events">Related Events</h2>
diff --git a/files/zh-cn/web/api/document/queryselector/index.html b/files/zh-cn/web/api/document/queryselector/index.html
index 8a449768ec..8f0332d2dc 100644
--- a/files/zh-cn/web/api/document/queryselector/index.html
+++ b/files/zh-cn/web/api/document/queryselector/index.html
@@ -29,7 +29,7 @@ translation_of: Web/API/Document/querySelector
</dl>
<div class="note">
-<p><strong>提示:</strong>必须使用反斜杠字符转义不属于标准CSS语法的字符。 由于JavaScript也使用退格转义,因此在使用这些字符编写字符串文字时必须特别小心。 有关详细信息,请参阅{{anch("Escaping special characters")}}。</p>
+<p><strong>提示:</strong>必须使用反斜杠字符转义不属于标准CSS语法的字符。 由于JavaScript也使用退格转义,因此在使用这些字符编写字符串文字时必须特别小心。 有关详细信息,请参阅<a href="#转义特殊字符">转义特殊字符</a>。</p>
</div>
<h3 id="返回值">返回值</h3>
diff --git a/files/zh-cn/web/api/document/queryselectorall/index.html b/files/zh-cn/web/api/document/queryselectorall/index.html
index 0e43d6020b..0f679ce98d 100644
--- a/files/zh-cn/web/api/document/queryselectorall/index.html
+++ b/files/zh-cn/web/api/document/queryselectorall/index.html
@@ -39,7 +39,7 @@ translation_of: Web/API/Document/querySelectorAll
</dl>
<div class="note">
-<p><strong>注意:</strong> 必须使用反斜杠字符转义不属于标准CSS语法的字符。 由于JavaScript也使用反斜杠转义,因此在使用这些字符编写字符串文字时必须特别小心。 有关详细信息,请参阅 {{anch("Escaping special characters")}}</p>
+<p><strong>注意:</strong> 必须使用反斜杠字符转义不属于标准CSS语法的字符。 由于JavaScript也使用反斜杠转义,因此在使用这些字符编写字符串文字时必须特别小心。有关详细信息,请参阅<a href="/zh-CN/docs/Web/API/Document/querySelector#转义特殊字符">转义特殊字符</a></p>
</div>
<h3 id="返回值">返回值</h3>
@@ -163,11 +163,7 @@ inner.length; // 0
<h2 id="浏览器兼容性">浏览器兼容性</h2>
-<div>
-
-
<p>{{Compat("api.Document.querySelectorAll")}}</p>
-</div>
<h2 id="相关连接">相关连接</h2>
diff --git a/files/zh-cn/web/api/document/title/index.html b/files/zh-cn/web/api/document/title/index.html
index 40056fafe2..9b91ecff0e 100644
--- a/files/zh-cn/web/api/document/title/index.html
+++ b/files/zh-cn/web/api/document/title/index.html
@@ -10,7 +10,7 @@ translation_of: Web/API/Document/title
<h2 id="Syntax" name="Syntax">语法</h2>
<pre class="syntaxbox"><em>var docTitle</em> = <em>document</em>.title;
</pre>
-<p><code>title</code> 是一个包含 <code>document</code> 标题的字符串。如果通过设置 <code>document.title</code> 将标题覆盖,则返回覆盖后的值。否则返回标签里指定的标题(参见下面的 {{Anch("Notes")}})。</p>
+<p><code>title</code> 是一个包含 <code>document</code> 标题的字符串。如果通过设置 <code>document.title</code> 将标题覆盖,则返回覆盖后的值。否则返回标签里指定的标题(参见下面的 <a href="#notes">Notes</a>)。</p>
<pre class="syntaxbox"><em>document</em>.title = <em>newTitle</em>;
</pre>
<p><code>newTitle</code> 是文档的新标题。赋值操作影响 <code>document.title</code> 的返回值,<span style="line-height: 1.5;">文档的显示标题(即窗口或标签页顶部的标题栏),另外还会影响文档的 DOM,即改变 HTML 文档中 </span><code style="font-style: normal; line-height: 1.5;">&lt;title&gt;</code><span style="line-height: 1.5;"> 元素的内容。</span></p>