diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:42:52 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:42:52 -0500 |
commit | 074785cea106179cb3305637055ab0a009ca74f2 (patch) | |
tree | e6ae371cccd642aa2b67f39752a2cdf1fd4eb040 /files/pt-br/web/api/eventsource/onerror/index.html | |
parent | da78a9e329e272dedb2400b79a3bdeebff387d47 (diff) | |
download | translated-content-074785cea106179cb3305637055ab0a009ca74f2.tar.gz translated-content-074785cea106179cb3305637055ab0a009ca74f2.tar.bz2 translated-content-074785cea106179cb3305637055ab0a009ca74f2.zip |
initial commit
Diffstat (limited to 'files/pt-br/web/api/eventsource/onerror/index.html')
-rw-r--r-- | files/pt-br/web/api/eventsource/onerror/index.html | 121 |
1 files changed, 121 insertions, 0 deletions
diff --git a/files/pt-br/web/api/eventsource/onerror/index.html b/files/pt-br/web/api/eventsource/onerror/index.html new file mode 100644 index 0000000000..09b996e967 --- /dev/null +++ b/files/pt-br/web/api/eventsource/onerror/index.html @@ -0,0 +1,121 @@ +--- +title: EventSource.onerror +slug: Web/API/EventSource/onerror +translation_of: Web/API/EventSource/onerror +--- +<div>{{APIRef('WebSockets API')}}</div> + +<div> </div> + +<p>A propriedade <code><strong>onerror</strong></code> da interface {{domxref("EventSource")}} é um {{domxref("EventHandler")}} chamado quando um erro ocorre e um evento {{event("error")}} é despachado para o objeto <code>EventSource</code>.</p> + +<h2 id="Sintaxe">Sintaxe</h2> + +<pre class="syntaxbox">eventSource.onerror = function</pre> + +<h2 id="Exemplos">Exemplos</h2> + +<pre class="brush: js">evtSource.onerror = function() { + console.log("EventSource failed."); +};</pre> + +<div class="note"> +<p><strong>Nota</strong>: Você pode encontrar um exemplo completo no GitHub — veja <a href="https://github.com/mdn/dom-examples/tree/master/server-sent-events">Simple SSE demo using PHP.</a></p> +</div> + +<h2 id="Especificações">Especificações</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">Especificação</th> + <th scope="col">Status</th> + <th scope="col">Comentário</th> + </tr> + <tr> + <td>{{SpecName('HTML WHATWG', "comms.html#handler-eventsource-onerror", "onerror")}}</td> + <td>{{Spec2('HTML WHATWG')}}</td> + <td>Definição inicial</td> + </tr> + </tbody> +</table> + +<ul> +</ul> + +<h2 id="Compatibilidade_de_navegadores">Compatibilidade de navegadores</h2> + +<div>{{CompatibilityTable}}</div> + +<div id="compat-desktop"> +<table class="compat-table"> + <tbody> + <tr> + <th>Feature</th> + <th>Chrome</th> + <th>Edge</th> + <th>Firefox (Gecko)</th> + <th>Internet Explorer</th> + <th>Opera</th> + <th>Safari</th> + </tr> + <tr> + <td>Suporte a EventSource</td> + <td>6</td> + <td>{{CompatNo}}</td> + <td>{{CompatGeckoDesktop("6.0")}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatVersionUnknown}}</td> + <td>5</td> + </tr> + <tr> + <td>Disponibilidade em workers compartilhados e dedicados<sup>[1]</sup></td> + <td>{{CompatVersionUnknown}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatGeckoDesktop("53.0")}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatVersionUnknown}}</td> + <td>{{CompatVersionUnknown}}</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>Suporte a EventSource</td> + <td>4.4</td> + <td>45</td> + <td>{{CompatNo}}</td> + <td>12</td> + <td>4.1</td> + </tr> + <tr> + <td>Disponibilidade em workers compartilhados e dedicados<sup>[1]</sup></td> + <td>{{CompatVersionUnknown}}</td> + <td>{{CompatGeckoMobile("53.0")}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatVersionUnknown}}</td> + <td>{{CompatVersionUnknown}}</td> + </tr> + </tbody> +</table> +</div> + +<p>[1] Mas <a href="https://github.com/w3c/ServiceWorker/issues/947">ainda não em service workers.</a></p> + +<h2 id="Veja_também">Veja também</h2> + +<ul> + <li>{{domxref("EventSource")}}</li> +</ul> |