aboutsummaryrefslogtreecommitdiff
path: root/files/ja/web/api/websocket/onerror/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/ja/web/api/websocket/onerror/index.html')
-rw-r--r--files/ja/web/api/websocket/onerror/index.html61
1 files changed, 61 insertions, 0 deletions
diff --git a/files/ja/web/api/websocket/onerror/index.html b/files/ja/web/api/websocket/onerror/index.html
new file mode 100644
index 0000000000..717a0ae735
--- /dev/null
+++ b/files/ja/web/api/websocket/onerror/index.html
@@ -0,0 +1,61 @@
+---
+title: WebSocket.onerror
+slug: Web/API/WebSocket/onerror
+tags:
+ - API
+ - Connection
+ - Error
+ - Error Handler
+ - Networking
+ - Property
+ - Reference
+ - Web API
+ - WebSocket
+ - onerror
+ - プロパティ
+translation_of: Web/API/WebSocket/onerror
+---
+<div>{{APIRef("Web Sockets API")}}</div>
+
+<p><span class="seoSummary">{{domxref("WebSocket")}} インターフェイスの <code><strong>onerror</strong></code> イベントハンドラープロパティは、 WebSocket でエラーが発生したときに呼び出される関数です。</span></p>
+
+<p><code>error</code> イベントハンドラーは {{domxref("EventTarget.addEventListener", "addEventListener()")}} で追加することもできます。</p>
+
+<h2 id="Syntax" name="Syntax">構文</h2>
+
+<pre class="syntaxbox"><em>webSocket</em>.onerror = <em>eventHandler</em>;</pre>
+
+<h3 id="Value" name="Value">値</h3>
+
+<p>関数または {{domxref("EventHandler")}} で、 WebSocket コネクションで <code>error</code> イベントが発生するたびに呼び出されるものです。</p>
+
+<h2 id="Example" name="Example">例</h2>
+
+<pre class="brush: js"><em>webSocket</em>.onerror = function(event) {
+ console.error("WebSocket error observed:", event);
+};</pre>
+
+<h2 id="Specifications" name="Specifications">仕様書</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-websocket-onerror', 'WebSocket: onerror')}}</td>
+ <td>{{Spec2('HTML WHATWG')}}</td>
+ <td>初回定義</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2>
+
+<div class="hidden">このページの互換性一覧表は構造化データから生成されています。データに協力していただけるのであれば、 <a class="external" href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> をチェックアウトしてプルリクエストを送信してください。</div>
+
+<p>{{Compat("api.WebSocket.onerror")}}</p>