diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/api/websocket/readystate/index.html | |
parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip |
initial commit
Diffstat (limited to 'files/zh-cn/web/api/websocket/readystate/index.html')
-rw-r--r-- | files/zh-cn/web/api/websocket/readystate/index.html | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/websocket/readystate/index.html b/files/zh-cn/web/api/websocket/readystate/index.html new file mode 100644 index 0000000000..e4d7bd23fb --- /dev/null +++ b/files/zh-cn/web/api/websocket/readystate/index.html @@ -0,0 +1,60 @@ +--- +title: WebSocket.readyState +slug: Web/API/WebSocket/readyState +tags: + - Web API + - WebSocket +translation_of: Web/API/WebSocket/readyState +--- +<p>{{APIRef("Web Sockets API")}}</p> + +<h2 id="概要">概要</h2> + +<p>返回当前 {{domxref("WebSocket")}} 的链接状态,只读。</p> + +<h2 id="语法">语法</h2> + +<pre class="syntaxbox notranslate">var readyState = <em>WebSocket</em>.readyState;</pre> + +<h2 id="值">值</h2> + +<p>以下其中之一</p> + +<dl> + <dt>0 (<code>WebSocket.CONNECTING</code>)</dt> + <dd>正在链接中</dd> + <dt>1 (<code>WebSocket.OPEN</code>)</dt> + <dd>已经链接并且可以通讯</dd> + <dt>2 (<code>WebSocket.CLOSING</code>)</dt> + <dd>连接正在关闭</dd> + <dt>3 (<code>WebSocket.CLOSED</code>)</dt> + <dd>连接已关闭或者没有链接成功</dd> +</dl> + +<h2 id="Specifications">Specifications</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th>Specification</th> + <th>Status</th> + <th>Comment</th> + </tr> + <tr> + <td><a class="external external-icon" href="https://html.spec.whatwg.org/multipage/web-sockets.html#dom-websocket-readystate" hreflang="en" lang="en">HTML Living Standard<br> + <small lang="en-US">The definition of 'WebSocket.readyState' in that specification.</small></a></td> + <td><span class="spec-Living">Living Standard</span></td> + <td>Initial definition</td> + </tr> + </tbody> +</table> + +<h2 id="Browser_compatibility">Browser compatibility</h2> + + + +<p>{{Compat("api.WebSocket.readyState")}}</p> + +<p> + <audio style="display: none;"></audio> +</p> |