aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/worker
diff options
context:
space:
mode:
authorRyan Johnson <rjohnson@mozilla.com>2021-05-28 12:36:36 -0700
committerGitHub <noreply@github.com>2021-05-28 12:36:36 -0700
commit05a7219ba9605649cb6daa281e26209eaa73adf0 (patch)
tree63c9443b214d52257ff4ef5546f9e70c8b7365cd /files/zh-cn/web/api/worker
parent220a7d23b0755acc06146c1262aa09ba22d6e3b1 (diff)
downloadtranslated-content-05a7219ba9605649cb6daa281e26209eaa73adf0.tar.gz
translated-content-05a7219ba9605649cb6daa281e26209eaa73adf0.tar.bz2
translated-content-05a7219ba9605649cb6daa281e26209eaa73adf0.zip
fix MacroWrongXRefError flaws for some domxref calls (#1018)
Diffstat (limited to 'files/zh-cn/web/api/worker')
-rw-r--r--files/zh-cn/web/api/worker/index.html2
-rw-r--r--files/zh-cn/web/api/worker/onmessage/index.html2
2 files changed, 2 insertions, 2 deletions
diff --git a/files/zh-cn/web/api/worker/index.html b/files/zh-cn/web/api/worker/index.html
index 915aceb681..552a122239 100644
--- a/files/zh-cn/web/api/worker/index.html
+++ b/files/zh-cn/web/api/worker/index.html
@@ -37,7 +37,7 @@ translation_of: Web/API/Worker
<dt>{{domxref("Worker.onmessage")}}</dt>
<dd>当{{domxref("MessageEvent")}}类型的事件冒泡到 worker 时,事件监听函数 {{ domxref("EventListener") }} 被调用.  例如,一个消息通过 {{domxref("DedicatedWorkerGlobalScope.postMessage")}},从执行者发送到父页面对象,消息保存在事件对象的 {{domxref("MessageEvent.data", "data")}} 属性中.</dd>
<dt>{{domxref("Worker.onmessageerror")}}</dt>
- <dd>当{{event("messageerror")}} 类型的事件发生时,对应的{{domxref("EventHandler")}} 代码被调用。</dd>
+ <dd>当{{event("messageerror")}} 类型的事件发生时,对应的{{event("Event_handlers", "event handler")}} 代码被调用。</dd>
</dl>
<h2 id="方法">方法</h2>
diff --git a/files/zh-cn/web/api/worker/onmessage/index.html b/files/zh-cn/web/api/worker/onmessage/index.html
index 9fb062c24f..5baa117035 100644
--- a/files/zh-cn/web/api/worker/onmessage/index.html
+++ b/files/zh-cn/web/api/worker/onmessage/index.html
@@ -5,7 +5,7 @@ translation_of: Web/API/Worker/onmessage
---
<p>{{APIRef("Web Workers API")}}</p>
-<p>{{domxref("Worker")}} 接口的<strong><code>onmessage</code></strong>属性表示一个{{domxref("EventHandler")}}事件处理函数,当{{event("message")}} 事件发生时,该函数被调用。这些事件所属{{domxref("MessageEvent")}}类型,且当Worker子线程返回一条消息时被调用(比如:从{{domxref("DedicatedWorkerGlobalScope.postMessage")}}函数发出的信息)</p>
+<p>{{domxref("Worker")}} 接口的<strong><code>onmessage</code></strong>属性表示一个{{event("Event_handlers", "event handler")}}事件处理函数,当{{event("message")}} 事件发生时,该函数被调用。这些事件所属{{domxref("MessageEvent")}}类型,且当Worker子线程返回一条消息时被调用(比如:从{{domxref("DedicatedWorkerGlobalScope.postMessage")}}函数发出的信息)</p>
<div class="note">
<p><strong>注意</strong>: 消息被装载到 {{event("message")}}事件对象的<code>data</code>属性。(译者:即传递的消息参数将被赋值给<code>onmessage</code>处理函数的事件参数<code>e</code>中的<code>data</code>属性)</p>