blob: b3e68f3274edb1799ea9785eb78af7a4099de41f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
---
title: WebSocket.onerror
slug: Web/API/WebSocket/error_event
tags:
- API
- Error
- Propiedad
- Referencia
- Web API
- WebSocket
translation_of: Web/API/WebSocket/onerror
original_slug: Web/API/WebSocket/onerror
---
<p>{{APIRef("Web Sockets API")}}</p>
<p>La propiedad <strong><code>WebSocket.onerror</code></strong>, del tipo {{event("Event_handlers", "event handler")}}, será llamada cuando se dé un error. Esta llamada recibirá un tipo {{domxref("Event")}} como argumento.</p>
<h2 id="Sintaxis">Sintaxis</h2>
<pre class="syntaxbox"><em>aWebSocket</em>.onerror = function(event) {
console.error("Error en el WebSocket detectado:", event);
};</pre>
<h2 id="Valor">Valor</h2>
<p>Un {{domxref("EventListener")}}.</p>
<h2 id="Especificaciones">Especificaciones</h2>
<table class="standard-table">
<thead>
<tr>
<th scope="col">Especificación</th>
<th scope="col">Estado</th>
<th scope="col">Comentarios</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{SpecName('HTML WHATWG', '#handler-websocket-onerror', 'WebSocket: onerror')}}</td>
<td>{{Spec2('HTML WHATWG')}}</td>
<td>Definición inicial.</td>
</tr>
</tbody>
</table>
<h2 id="Compatibilidad_con_navegadores">Compatibilidad con navegadores</h2>
<p>{{Compat("api.WebSocket.onerror")}}</p>
|