diff options
author | Florian Merz <me@fiji-flo.de> | 2021-02-11 13:12:08 +0100 |
---|---|---|
committer | Florian Merz <me@fiji-flo.de> | 2021-02-11 13:12:08 +0100 |
commit | 43a5cac2eff22c21071800e13bef12af9d3a37d0 (patch) | |
tree | f6e91f8aa958f15bd0b0aabf7b8dfc09063eceda /files/zh-tw/websockets/websockets_reference/closeevent | |
parent | 8260a606c143e6b55a467edf017a56bdcd6cba7e (diff) | |
download | translated-content-43a5cac2eff22c21071800e13bef12af9d3a37d0.tar.gz translated-content-43a5cac2eff22c21071800e13bef12af9d3a37d0.tar.bz2 translated-content-43a5cac2eff22c21071800e13bef12af9d3a37d0.zip |
unslug zh-tw: move
Diffstat (limited to 'files/zh-tw/websockets/websockets_reference/closeevent')
-rw-r--r-- | files/zh-tw/websockets/websockets_reference/closeevent/index.html | 145 |
1 files changed, 0 insertions, 145 deletions
diff --git a/files/zh-tw/websockets/websockets_reference/closeevent/index.html b/files/zh-tw/websockets/websockets_reference/closeevent/index.html deleted file mode 100644 index 0a6d0977ff..0000000000 --- a/files/zh-tw/websockets/websockets_reference/closeevent/index.html +++ /dev/null @@ -1,145 +0,0 @@ ---- -title: CloseEvent -slug: WebSockets/WebSockets_reference/CloseEvent -tags: - - WebSockets -translation_of: Web/API/CloseEvent ---- -<p>{{ draft() }}</p> -<p>當 WebSocket 連線關閉時,客戶端會收到一個 <code>CloseEvent</code>,由 <code>WebSocket</code> 物件 <code>onclose</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>code</code></td> - <td><code><a href="/en/unsigned_long" title="en/unsigned long">unsigned long</a></code></td> - <td>WebSocket 伺服器給予的連線關閉代碼。「狀態代碼」列有所有可能值。</td> - </tr> - <tr> - <td><code>reason</code></td> - <td>{{ domxref("DOMString") }}</td> - <td>表示伺服器關閉連線的原因,這因不同的伺服器與子協定而定。</td> - </tr> - <tr> - <td><code>wasClean</code></td> - <td><code>boolean</code></td> - <td>表示連線關閉情況是否乾淨。</td> - </tr> - </tbody> -</table> -<h2 id="狀態代碼">狀態代碼</h2> -<p>以下列有所有合法的狀態代碼。</p> -<table class="standard-table"> - <tbody> - <tr> - <td class="header">狀態代碼</td> - <td class="header">描述</td> - </tr> - <tr> - <td>0-999</td> - <td><strong>尚未使用的保留值。</strong></td> - </tr> - <tr> - <td>1000</td> - <td>正常關閉,連線成功地達到建立時的目標。</td> - </tr> - <tr> - <td>1001</td> - <td>端點去離,伺服器故障或是瀏覽器從開啟連線的頁面離去的情形。</td> - </tr> - <tr> - <td>1002</td> - <td>因協定錯誤造成連線被端點消滅。</td> - </tr> - <tr> - <td>1003</td> - <td>因端點接收不能處理的資料形態(舉例來說,文字端點收到二進制資料)而消滅連線。</td> - </tr> - <tr> - <td>1004</td> - <td>端點收到過大的資料幀而消滅連線。</td> - </tr> - <tr> - <td>1005</td> - <td><strong>保留值。</strong>表示意外地未給予狀態代碼的情形。</td> - </tr> - <tr> - <td>1006</td> - <td><strong>保留值。</strong>用以表示在預期收到狀態代碼的情形下不正常(即未送關閉幀)的連線關閉。</td> - </tr> - <tr> - <td>1007-1999</td> - <td><strong>保留以作為未來的 WebSocket 標準之用。</strong></td> - </tr> - <tr> - <td>2000-2999</td> - <td><strong>保留以作為 WebSocket 擴展之用。</strong></td> - </tr> - <tr> - <td>3000-3999</td> - <td>程式庫與框架使用的值,應用程式<strong>可不</strong>使用。</td> - </tr> - <tr> - <td>4000-4999</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>{{ CompatNo() }}</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>功能</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>{{ CompatNo() }}</td> - <td>{{ CompatUnknown() }}</td> - <td>{{ CompatUnknown() }}</td> - <td>{{ CompatUnknown() }}</td> - </tr> - </tbody> - </table> -</div> -<h3 id="Gecko_備註">Gecko 備註</h3> -<p>此時此刻,Gecko 送至監聽器的 "close" 事件僅是簡單事件。</p> -<p>{{ languages ( {"en": "en/WebSockets/WebSockets_reference/CloseEvent"} ) }}</p> |