aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/windoweventhandlers
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/windoweventhandlers
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/windoweventhandlers')
-rw-r--r--files/zh-cn/web/api/windoweventhandlers/index.html189
-rw-r--r--files/zh-cn/web/api/windoweventhandlers/onafterprint/index.html107
-rw-r--r--files/zh-cn/web/api/windoweventhandlers/onbeforeprint/index.html62
-rw-r--r--files/zh-cn/web/api/windoweventhandlers/onlanguagechange/index.html101
-rw-r--r--files/zh-cn/web/api/windoweventhandlers/onmessage/index.html84
-rw-r--r--files/zh-cn/web/api/windoweventhandlers/onmessageerror/index.html119
-rw-r--r--files/zh-cn/web/api/windoweventhandlers/onstorage/index.html98
7 files changed, 760 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/windoweventhandlers/index.html b/files/zh-cn/web/api/windoweventhandlers/index.html
new file mode 100644
index 0000000000..72a8a78eb9
--- /dev/null
+++ b/files/zh-cn/web/api/windoweventhandlers/index.html
@@ -0,0 +1,189 @@
+---
+title: WindowEventHandlers
+slug: Web/API/WindowEventHandlers
+tags:
+ - API
+ - HTML-DOM
+ - Interface
+ - NeedsTranslation
+ - Reference
+ - TopicStub
+translation_of: Web/API/WindowEventHandlers
+---
+<div>{{APIRef("HTML DOM")}}</div>
+
+<p><strong><code>WindowEventHandlers</code></strong> mixin 描述了事件处理程序常见的一些公共接口 ,例如{{domxref("Window")}}和 {{domxref("HTMLBodyElement")}} 和 {{domxref("HTMLFrameSetElement")}}等这些接口都实现了下列特定的事件处理程序。</p>
+
+<p><code>WindowEventHandlers不是一个接口,没有这种类型的对象可以创建。</code></p>
+
+<h2 id="Properties">Properties</h2>
+
+<p><em>The events properties, of the form <code>onXYZ</code>, are defined on the {{domxref("WindowEventHandlers")}}, and implemented by {{domxref("Window")}}, and {{domxref("WorkerGlobalScope")}} for Web Workers.</em></p>
+
+<dl>
+ <dt>{{domxref("WindowEventHandlers.onafterprint")}}</dt>
+ <dd>Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("afterprint")}} event is raised.</dd>
+ <dt>{{domxref("WindowEventHandlers.onbeforeprint")}}</dt>
+ <dd>Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("beforeprint")}} event is raised.</dd>
+ <dt>{{domxref("WindowEventHandlers.onbeforeunload")}}</dt>
+ <dd>Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("beforeunload")}} event is raised.</dd>
+ <dt>{{domxref("WindowEventHandlers.onhashchange")}}</dt>
+ <dd>Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("hashchange")}} event is raised.</dd>
+ <dt>{{domxref("WindowEventHandlers.onlanguagechange")}} {{experimental_inline}}</dt>
+ <dd>Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("languagechange")}} event is raised.</dd>
+ <dt>{{domxref("WindowEventHandlers.onmessage")}}</dt>
+ <dd>Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("message")}} event is raised.</dd>
+ <dt>{{domxref("WindowEventHandlers.onoffline")}}</dt>
+ <dd>Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("offline")}} event is raised.</dd>
+ <dt>{{domxref("WindowEventHandlers.ononline")}}</dt>
+ <dd>Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("online")}} event is raised.</dd>
+ <dt>{{domxref("WindowEventHandlers.onpagehide")}}</dt>
+ <dd>Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("pagehide")}} event is raised.</dd>
+ <dt>{{domxref("WindowEventHandlers.onpageshow")}}</dt>
+ <dd>Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("pageshow")}} event is raised.</dd>
+ <dt>{{domxref("WindowEventHandlers.onpopstate")}}</dt>
+ <dd>Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("popstate")}} event is raised.</dd>
+ <dt>{{domxref("WindowEventHandlers.onstorage")}}</dt>
+ <dd>Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("storage")}} event is raised.</dd>
+ <dt>{{domxref("WindowEventHandlers.onunhandledrejection")}} {{experimental_inline}}</dt>
+ <dd>An event handler for unhandled {{jsxref("Promise")}} rejection events.</dd>
+ <dt>{{domxref("WindowEventHandlers.onunload")}}</dt>
+ <dd>Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("unload")}} event is raised.</dd>
+</dl>
+
+<h2 id="Methods">Methods</h2>
+
+<p><em>This interface defines no method.</em></p>
+
+<h2 id="Specifications">Specifications</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{SpecName('HTML WHATWG', '#windoweventhandlers', 'GlobalEventHandlers')}}</td>
+ <td>{{Spec2('HTML WHATWG')}}</td>
+ <td>No change since the latest snapshot, {{SpecName("HTML5.1")}}.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('HTML5.1', '#windoweventhandlers', 'GlobalEventHandlers')}}</td>
+ <td>{{Spec2('HTML5.1')}}</td>
+ <td>Snapshot of {{SpecName("HTML WHATWG")}}. Added <code>onlanguage</code> since the {{SpecName("HTML5 W3C")}} snapshot.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName("HTML5 W3C", "#windoweventhandlers", "GlobalEventHandlers")}}</td>
+ <td>{{Spec2('HTML5 W3C')}}</td>
+ <td>Snapshot of {{SpecName("HTML WHATWG")}}. Creation of <code>WindowEventHandlers</code> (properties where on the target before it).</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Browser_compatibility">Browser compatibility</h2>
+
+<p>{{CompatibilityTable}}</p>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Firefox (Gecko)</th>
+ <th>Chrome</th>
+ <th>Internet Explorer</th>
+ <th>Opera</th>
+ <th>Safari</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ </tr>
+ <tr>
+ <td><code>onhashchange</code></td>
+ <td>{{CompatGeckoDesktop(1.9.2)}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ </tr>
+ <tr>
+ <td><code>onlanguage</code>{{experimental_inline}}</td>
+ <td>{{CompatGeckoDesktop(32)}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ </tr>
+ <tr>
+ <td><code>onstorage</code></td>
+ <td>{{CompatGeckoDesktop(45)}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<div id="compat-mobile">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>Android</th>
+ <th>IE Mobile</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td rowspan="1">{{CompatUnknown}}</td>
+ <td rowspan="1">{{CompatUnknown}}</td>
+ <td rowspan="1">{{CompatUnknown}}</td>
+ <td rowspan="1">{{CompatUnknown}}</td>
+ </tr>
+ <tr>
+ <td><code>onhashchange</code></td>
+ <td>{{CompatGeckoMobile(1.9.2)}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ </tr>
+ <tr>
+ <td><code>onlanguage</code>{{experimental_inline}}</td>
+ <td>{{CompatGeckoMobile(32)}}</td>
+ <td rowspan="1">{{CompatUnknown}}</td>
+ <td rowspan="1">{{CompatUnknown}}</td>
+ <td rowspan="1">{{CompatUnknown}}</td>
+ <td rowspan="1">{{CompatUnknown}}</td>
+ </tr>
+ <tr>
+ <td><code>onstorage</code></td>
+ <td>{{CompatGeckoDesktop(45)}}</td>
+ <td rowspan="1">{{CompatUnknown}}</td>
+ <td rowspan="1">{{CompatUnknown}}</td>
+ <td rowspan="1">{{CompatUnknown}}</td>
+ <td rowspan="1">{{CompatUnknown}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<h2 id="See_also">See also</h2>
+
+<ul>
+ <li>{{domxref("Window")}} and {{domxref("WorkerGlobalScope")}}</li>
+</ul>
diff --git a/files/zh-cn/web/api/windoweventhandlers/onafterprint/index.html b/files/zh-cn/web/api/windoweventhandlers/onafterprint/index.html
new file mode 100644
index 0000000000..cdf54dcead
--- /dev/null
+++ b/files/zh-cn/web/api/windoweventhandlers/onafterprint/index.html
@@ -0,0 +1,107 @@
+---
+title: WindowEventHandlers.onafterprint
+slug: Web/API/WindowEventHandlers/onafterprint
+tags:
+ - 打印
+translation_of: Web/API/WindowEventHandlers/onafterprint
+---
+<div>{{ApiRef}}</div>
+
+<p>{{domxref("WindowEventHandlers")}}的onafterprint属性是用于处理当前窗口的{{event("afterprint")}}事件的{{domxref("EventHandler")}}。这些事件会在被用户打印结束或者中止打印窗口的情况下触发。</p>
+
+<p>{{event("beforeprint")}}和<code>afterprint</code> 事件允许页面在打印开始前修改它们的内容(比如移除一个横幅等),打印结束后,这些修改会恢复原状。一般情况下,你更喜欢使用 <code><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries#Media_types">@media print</a></code> CSS规则,但是在某些情况下这些事件会有他们的必要性。</p>
+
+<h2 id="语法">语法</h2>
+
+<pre class="syntaxbox"><em>window</em>.addEventListener("afterprint", function(event) { ... });
+<em>window</em>.onafterprint = <em>event handling code</em>
+</pre>
+
+<h2 id="提示">提示</h2>
+
+<p>某些浏览器(包括 Firefox 6 及更高版本和 Internet Explorer)用触发<code>beforeprint</code> 和<code>afterprint</code>的方式来确定何时进行了打印。你可以在打印期间用这个方式来调整用户界面(UI)的表现(比如在打印过程中展示或隐藏一些界面元素)。</p>
+
+<p><code>afterprint</code>会在用户打印完成或取消打印会话后触发。</p>
+
+<h2 id="规范">规范</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', '/multipage/webappapis.html#windoweventhandlers', 'onafterprint')}}</td>
+ <td>{{Spec2('HTML WHATWG')}}</td>
+ <td></td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
+
+<p>{{CompatibilityTable}}</p>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Chrome</th>
+ <th>Edge</th>
+ <th>Firefox (Gecko)</th>
+ <th>Internet Explorer</th>
+ <th>Opera</th>
+ <th>Safari</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>6.0</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<div id="compat-mobile">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Android Webview</th>
+ <th>Chrome for Android</th>
+ <th>Edge</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>IE Mobile</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ </tr>
+ <tr>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatUnknown}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<h2 id="更多请见">更多请见</h2>
+
+<ul>
+ <li>{{domxref("window.print")}}</li>
+ <li>{{domxref("window.onbeforeprint")}}</li>
+ <li><a href="/en-US/docs/Printing" title="Printing">Printing</a></li>
+</ul>
+
+<div class="grammarly-disable-indicator"></div>
diff --git a/files/zh-cn/web/api/windoweventhandlers/onbeforeprint/index.html b/files/zh-cn/web/api/windoweventhandlers/onbeforeprint/index.html
new file mode 100644
index 0000000000..834ca04cf0
--- /dev/null
+++ b/files/zh-cn/web/api/windoweventhandlers/onbeforeprint/index.html
@@ -0,0 +1,62 @@
+---
+title: WindowEventHandlers.onbeforeprint
+slug: Web/API/WindowEventHandlers/onbeforeprint
+translation_of: Web/API/WindowEventHandlers/onbeforeprint
+---
+<div>{{ApiRef}}</div>
+
+<div>{{domxref("WindowEventHandlers")}}的<code><strong>onbeforeprint</strong></code>属性是用于处理当前窗口的{{event("beforeprint")}}事件的{{domxref("EventHandler")}}。在打开打印对话窗口之前会触发这些事件。</div>
+
+<div></div>
+
+<div><font><font>在</font></font><code>beforeprint</code><font><font>和</font></font>{{event("afterprint")}}<font><font>事件允许网页在打印开始前更改他们的内容(例如:可能是删除一个横幅),然后在打印完成后恢复这些更改。通常,您应该更喜欢使用</font></font><code><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries#Media_types">@media print</a></code><font><font>CSS规则,但是在某些情况下可能有必要使用这些事件。</font></font></div>
+
+<h2 id="语法">语法</h2>
+
+<pre class="syntaxbox notranslate">window.addEventListener("beforeprint", function(event) { ... });
+window.onbeforeprint = function(event) { ... };
+</pre>
+
+<h2 id="范例">范例</h2>
+
+<p><font><font>Safari没有实现这些事件,但是您可以使用创建与</font></font><code>beforeprint</code><font><font>事件</font><font>等效的结果</font><font>。</font></font>{{domxref("window.matchMedia")}}<code>('print')</code></p>
+
+<pre class="brush: js notranslate">var mediaQueryList = window.matchMedia('print');
+mediaQueryList.addListener(function(mql) {
+ if(mql.matches) {
+ console.log('webkit equivalent of onbeforeprint');
+ }
+});</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', '#handler-window-onbeforeprint', 'onbeforeprint')}}</td>
+ <td>{{Spec2('HTML WHATWG')}}</td>
+ <td></td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
+
+
+
+<p>{{Compat("api.WindowEventHandlers.onbeforeprint")}}</p>
+
+<h2 id="参阅">参阅</h2>
+
+<ul>
+ <li>{{domxref("Window.print()")}}</li>
+ <li>{{domxref("WindowEventHandlers.onafterprint")}}</li>
+ <li><a href="/en-US/docs/Web/Guide/Printing">Printing</a></li>
+</ul>
diff --git a/files/zh-cn/web/api/windoweventhandlers/onlanguagechange/index.html b/files/zh-cn/web/api/windoweventhandlers/onlanguagechange/index.html
new file mode 100644
index 0000000000..ccabcc1c2e
--- /dev/null
+++ b/files/zh-cn/web/api/windoweventhandlers/onlanguagechange/index.html
@@ -0,0 +1,101 @@
+---
+title: WindowEventHandlers.onlanguagechange
+slug: Web/API/WindowEventHandlers/onlanguagechange
+translation_of: Web/API/WindowEventHandlers/onlanguagechange
+---
+<p>{{APIRef("HTML DOM")}}{{SeeCompatTable}}</p>
+
+<p><code><strong>WindowEventHandlers.onlanguagechange</strong></code> 事件是一个属性,包含待执行的代码。当 {{domxref("Event")}} 类型的 {{event("languagechange")}} 事件被这些接口实现的对象(如 {{domxref("Window")}}、{{domxref("HTMLBodyElement")}} 或者 {{domxref("HTMLIFrameElement")}} 等对象)触发时,该事件属性的代码将被运行。这样的事件在浏览器通知更佳的语言列表已被更新后被触发。关于语言列表的介绍,您可访问:{{domxref("NavigatorLanguage.languages")}}。</p>
+
+<h2 id="语法">语法</h2>
+
+<pre class="eval"><em>object</em>.onlanguagechange = <em>function</em>;
+</pre>
+
+<h3 id="值">值</h3>
+
+<ul>
+ <li><code>function</code> 是用户定义的函数的名字 ,不需要 <code>()</code> 的后缀或者任何形式参数, 或者是匿名函数,例如 <code>function(event) {...}</code>。事件处理程序总是有一个单一的形式参数,包含一个事件,这里有它的类型 {{domxref("Event")}}.</li>
+</ul>
+
+<h2 id="例子">例子</h2>
+
+<pre class="brush: js">window.onlanguagechange = function(ev) { alert("languagechange event detected!"); };
+</pre>
+
+<h2 id="Specifications" name="Specifications">标准</h2>
+
+<table class="standard-table" style="height: 49px; width: 1000px;">
+ <thead>
+ <tr>
+ <th scope="col">标准</th>
+ <th scope="col">状态</th>
+ <th scope="col">备注</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{ SpecName('HTML WHATWG', '#handler-workerglobalscope-onlanguagechange', 'WindowEventHandler.onlanguagechange') }}</td>
+ <td>{{ Spec2('HTML WHATWG') }}</td>
+ <td>初始版本</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
+
+<p>{{ CompatibilityTable() }}</p>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Chrome</th>
+ <th>Firefox (Gecko)</th>
+ <th>Internet Explorer</th>
+ <th>Opera</th>
+ <th>Safari</th>
+ </tr>
+ <tr>
+ <td>基础支持</td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatGeckoDesktop(32.0) }}</td>
+ <td>{{ CompatNo() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<div id="compat-mobile">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Android</th>
+ <th>Chrome for Android</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>IE Mobile</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ </tr>
+ <tr>
+ <td>基础支持</td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatGeckoMobile(32.0) }}</td>
+ <td>{{ CompatNo() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<h2 id="参见">参见</h2>
+
+<ul>
+ <li>{{event("languagechange")}} 事件和它的类型 {{domxref("Event")}}。</li>
+</ul>
diff --git a/files/zh-cn/web/api/windoweventhandlers/onmessage/index.html b/files/zh-cn/web/api/windoweventhandlers/onmessage/index.html
new file mode 100644
index 0000000000..bdbcdc3f2f
--- /dev/null
+++ b/files/zh-cn/web/api/windoweventhandlers/onmessage/index.html
@@ -0,0 +1,84 @@
+---
+title: onmessage
+slug: Web/API/WindowEventHandlers/onmessage
+translation_of: Web/API/WindowEventHandlers/onmessage
+---
+<p>{{APIRef("HTML DOM")}}{{ SeeCompatTable() }}</p>
+
+<p>{{domxref("WindowEventHandlers")}}的<code><strong>onmessage</strong></code><strong> 属性是当对象接收到</strong>{{event("message")}} <strong>事件时被调用的</strong>{{domxref("EventHandler")}} <strong>.</strong></p>
+
+<h2 id="语法">语法</h2>
+
+<pre class="syntaxbox">window.addEventListener('message', function(event) { ... })
+window.onmessage = function(event) { ... }</pre>
+
+<h2 id="规范">规范</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','#handler-window-onmessage','onmessage')}}</td>
+ <td>{{Spec2('HTML WHATWG')}}</td>
+ <td>Initial definition.</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
+
+<div>{{CompatibilityTable}}</div>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Chrome</th>
+ <th>Firefox (Gecko)</th>
+ <th>Internet Explorer</th>
+ <th>Opera</th>
+ <th>Safari (WebKit)</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatChrome(60)}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatOpera(47)}}</td>
+ <td>{{CompatUnknown}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<div id="compat-mobile">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Android Webview</th>
+ <th>Chrome for Android</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>Firefox OS</th>
+ <th>IE Mobile</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatChrome(60)}}</td>
+ <td>{{CompatChrome(60)}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatOperaMobile(47)}}</td>
+ <td>{{CompatUnknown}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
diff --git a/files/zh-cn/web/api/windoweventhandlers/onmessageerror/index.html b/files/zh-cn/web/api/windoweventhandlers/onmessageerror/index.html
new file mode 100644
index 0000000000..609f9a9923
--- /dev/null
+++ b/files/zh-cn/web/api/windoweventhandlers/onmessageerror/index.html
@@ -0,0 +1,119 @@
+---
+title: WindowEventHandlers.onmessageerror
+slug: Web/API/WindowEventHandlers/onmessageerror
+translation_of: Web/API/WindowEventHandlers/onmessageerror
+---
+<div>{{APIRef("HTML DOM")}}</div>
+
+<p> </p>
+
+<p>{{domxref("WindowEventHandlers")}}接口的onmessageerror事件处理器是一个 {{domxref("EventListener")}},每当一个类型为 <span class="seoSummary"><code>messageerror</code> </span>的 {{domxref("EventListener")}} 事件在一个窗口被触发 --也就是说,当它收到的消息不能是{{glossary("Deserialization", "deserialized")}} 。</p>
+
+<p>{{AvailableInWorkers}}</p>
+
+<p> </p>
+
+<h2 id="语法">语法</h2>
+
+<pre class="syntaxbox"><em>window</em>.onmessageerror = function() { ... };</pre>
+
+<h2 id="规范">规范</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', '#handler-window-onmessageerror', 'onmessageerror')}}</td>
+ <td>{{Spec2('HTML WHATWG')}}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
+
+<div>{{CompatibilityTable}}</div>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Chrome</th>
+ <th>Edge</th>
+ <th>Firefox (Gecko)</th>
+ <th>Internet Explorer</th>
+ <th>Opera</th>
+ <th>Safari (WebKit)</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatChrome(60)}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatGeckoDesktop(57)}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatOpera(47)}}</td>
+ <td>{{CompatUnknown}}</td>
+ </tr>
+ <tr>
+ <td>Available in workers</td>
+ <td>{{CompatChrome(60)}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatGeckoDesktop(57)}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatOpera(47)}}</td>
+ <td>{{CompatUnknown}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<div id="compat-mobile">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Android Webview</th>
+ <th>Chrome for Android</th>
+ <th>Edge</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>Firefox OS (Gecko)</th>
+ <th>IE Phone</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatChrome(60)}}</td>
+ <td>{{CompatChrome(60)}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatGeckoMobile(57)}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatOpera(47)}}</td>
+ <td>{{CompatUnknown}}</td>
+ </tr>
+ <tr>
+ <td>Available in workers</td>
+ <td>{{CompatChrome(60)}}</td>
+ <td>{{CompatChrome(60)}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatGeckoMobile(57)}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatOpera(47)}}</td>
+ <td>{{CompatUnknown}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<h2 id="See_also">See also</h2>
+
+<ul>
+ <li><a href="/en-US/docs/Web/API/Channel_Messaging_API/Using_channel_messaging">Using channel messaging</a></li>
+</ul>
diff --git a/files/zh-cn/web/api/windoweventhandlers/onstorage/index.html b/files/zh-cn/web/api/windoweventhandlers/onstorage/index.html
new file mode 100644
index 0000000000..fe7dc2a7cc
--- /dev/null
+++ b/files/zh-cn/web/api/windoweventhandlers/onstorage/index.html
@@ -0,0 +1,98 @@
+---
+title: WindowEventHandlers.onstorage
+slug: Web/API/WindowEventHandlers/onstorage
+tags:
+ - API
+ - Web Storage
+ - WindowEventHandlers
+ - 属性
+translation_of: Web/API/WindowEventHandlers/onstorage
+---
+<div class="syntaxbox">{{ ApiRef() }}</div>
+
+<p><strong><code>WindowEventHandlers.onstorage</code></strong> 属性包含一个在{{event("storage")}}事件触发时的事件句柄。 </p>
+
+<p>注意:该事件不在导致数据变化的当前页面触发(如果浏览器同时打开一个域名下面的多个页面,当其中的一个页面改变 <code>sessionStorage</code> 或 <code>localStorage</code> 的数据时,其他所有页面的  <code>storage</code>  事件会被触发,而原始页面并不触发 <code>storage</code> 事件)</p>
+
+<h2 id="Syntax" name="Syntax">语法</h2>
+
+<pre class="syntaxbox"><em>windowObj</em>.onstorage = function() { ... };</pre>
+
+<h2 id="Specification" name="Specification">用例</h2>
+
+<pre class="brush: js">window.onstorage = function(e) {
+ console.log( e.key + ' 键已经从 ' + e.oldValue + ' 改变为 ' + e.newValue + '.');
+};</pre>
+
+<h2 id="说明书">说明书</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','webappapis.html#handler-window-onstorage','onstorage')}}</td>
+ <td>{{Spec2('HTML WHATWG')}}</td>
+ <td></td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
+
+<p>{{CompatibilityTable}}</p>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Chrome</th>
+ <th>Firefox (Gecko)</th>
+ <th>Internet Explorer</th>
+ <th>Opera</th>
+ <th>Safari (WebKit)</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatGeckoDesktop(45)}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<div id="compat-mobile" style="line-height: 19.0909080505371px;">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Android</th>
+ <th>Android Webview</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>Firefox OS</th>
+ <th>IE Mobile</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ <th>Chrome for Android</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatGeckoMobile(45)}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>