package js.html
extends EventTarget
Available on jsThe
EventSourceinterface is used to receive server-sent events. It connects to a server over HTTP and receives events intext/event-streamformat without closing the connection.Documentation EventSource by Mozilla Contributors, licensed under CC-BY-SA 2.5.
See:
new (url:String, ?eventSourceInitDict:EventSourceInit)Throws:
null |
DOMError |
|---|
onerror:FunctionIs an EventHandler being called when an error occurs and the error event is dispatched on this object.
onmessage:FunctionIs an EventHandler being called when a message event is received, that is when a message is coming from the source.
onopen:FunctionIs an EventHandler being called when an open event is received, that is when the connection was just opened.
read only readyState:IntAn unsigned short representing the state of the connection. Possible values are CONNECTING (0), OPEN (1), or CLOSED (2).
read only url:StringA DOMString representing the URL of the source.
read only withCredentials:Boolclose ():VoidCloses the connection, if any, and sets the readyState attribute to CLOSED. If the connection is already closed, the method does nothing.
static inline read only CLOSED:Int = 2 static inline read only CONNECTING:Int = 0 static inline read only OPEN:Int = 1
© 2005–2018 Haxe Foundation
Licensed under a MIT license.
https://api.haxe.org/js/html/EventSource.html