diff options
Diffstat (limited to 'files/zh-tw/websockets/websockets_reference/messageevent/index.html')
-rw-r--r-- | files/zh-tw/websockets/websockets_reference/messageevent/index.html | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/files/zh-tw/websockets/websockets_reference/messageevent/index.html b/files/zh-tw/websockets/websockets_reference/messageevent/index.html new file mode 100644 index 0000000000..f5c0212f78 --- /dev/null +++ b/files/zh-tw/websockets/websockets_reference/messageevent/index.html @@ -0,0 +1,80 @@ +--- +title: MessageEvent +slug: WebSockets/WebSockets_reference/MessageEvent +tags: + - WebSockets +translation_of: Web/API/MessageEvent +--- +<p>{{ draft() }}</p> +<p>當伺服器傳來資料時,客戶端會收到一個 <code>MessageEvent</code>,由 <code>WebSocket</code> 物件 <code>onmessage</code> 表示的監聽器接收。</p> +<h2 id="Attributes" name="Attributes">屬性</h2> +<table class="standard-table"> + <tbody> + <tr> + <td class="header">屬性</td> + <td class="header">形態</td> + <td class="header">描述</td> + </tr> + <tr> + <td><code>data</code></td> + <td>{{ domxref("DOMString") }} | {{ domxref("Blob") }} | <a href="/zh_tw/JavaScript_typed_arrays/ArrayBuffer" title="zh tw/JavaScript typed arrays/ArrayBuffer"><code>ArrayBuffer</code></a></td> + <td>伺服器傳來的資料。</td> + </tr> + </tbody> +</table> +<h2 id="參見">參見</h2> +<ul> + <li><a href="/zh_tw/WebSockets/WebSockets_reference/WebSocket" title="zh tw/WebSockets/WebSockets reference/WebSocket"><code>WebSocket</code></a></li> +</ul> +<h2 id="瀏覽器兼容">瀏覽器兼容</h2> +<p>{{ CompatibilityTable() }}</p> +<div id="compat-desktop"> + <table class="compat-table"> + <tbody> + <tr> + <th>功能</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("2.0") }}</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>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>{{ CompatUnknown() }}</td> + <td>{{ CompatUnknown() }}</td> + <td>{{ CompatUnknown() }}</td> + </tr> + </tbody> + </table> +</div> +<h3 id="Gecko_備註">Gecko 備註</h3> +<div class="geckoVersionNote"> + <p>{{ gecko_callout_heading("6.0") }}</p> + <p>此時此刻,Gecko 不支援 <code><a href="/en/JavaScript_typed_arrays/ArrayBuffer" title="en/JavaScript typed arrays/ArrayBuffer">ArrayBuffer</a></code> 或 {{ domxref("Blob") }} 作為 <code>data</code>。</p> +</div> +<p>{{ languages ( {"en": "en/WebSockets/WebSockets_reference/MessageEvent"} ) }}</p> |