The EventSource
interface is web content's interface to server-sent events. An EventSource
instance opens a persistent connection to an HTTP server, which sends events in text/event-stream
format.
Documentation EventSource by Mozilla Contributors, licensed under CC-BY-SA 2.5.
See also:
Static variables
Constructor
Variables
onerror:Function
Is an EventHandler
called when an error occurs and the error
event is dispatched on an EventSource
object.
onmessage:Function
Is an EventHandler
called when a message
event is received, that is when a message is coming from the source.
onopen:Function
Is an EventHandler
called when an open
event is received, that is when the connection was just opened.
read onlyreadyState:Int
A number representing the state of the connection. Possible values are CONNECTING
(0
), OPEN
(1
), or CLOSED
(2
).
read onlywithCredentials:Bool
A Boolean
indicating whether the EventSource
object was instantiated with cross-origin (CORS) credentials set (true
), or not (false
, the default).