Compare Revisions

Using server-sent events

Revision 347047:

Revision 347047 by TwelveBaud on

Revision 386337:

Revision 386337 by DirkjanOchtman on

Title:
Using server-sent events
Using server-sent events
Slug:
Server-sent_events/Using_server-sent_events
Server-sent_events/Using_server-sent_events
Tags:
"DOM","NeedsTechnicalReview","Server-sent events"
"DOM","NeedsTechnicalReview","Server-sent events"
Content:

Revision 347047
Revision 386337
tt92    </p>
93    <h2>
94      Error handling
95    </h2>
96    <p>
97      When problems occur (such as a network timeout or issues pe
 >rtaining to <a href="/en-US/docs/HTTP/Access_control_CORS" title=
 >"/en-US/docs/HTTP/Access_control_CORS">access control</a>), an er
 >ror event is generated. You can take action on this by implementi
 >ng the <code>onerror</code> callback on the EventSource object:
98    </p>
99    <pre class="brush: js">
100evtSource.onerror = function(e) {
101  alert("EventSource failed.");
102};
103</pre>
104    <p>
105      As of Firefox 22, it does not appear that there is any way 
 >to distinguish between different kinds of error events.

Back to History