haXe API Documentation
Back | Index
extern class js.html.EventSource
extends EventTarget
Available in js

The EventSource interface is used to manage server-sent events. You can set the onmessage attribute to a JavaScript function to receive non-typed messages (that is, messages with no event field). You can also call addEventListener() to listen for events just like any other event source.

See Using server-sent events for further details.



Documentation for this class was provided by MDN.
var URL(default,null) : String
var onerror : EventListener
A JavaScript function to call when an error occurs.
var onmessage : EventListener
A JavaScript function to call when an a message without an event field arrives.
var onopen : EventListener
A JavaScript function to call when the connection has opened.
var readyState(default,null) : Int
The state of the connection, must be one of CONNECTING, OPEN, or CLOSED. Read only.
var url(default,null) : String
Read only.
function new() : Void
function close() : Void
static inline var CLOSED : Int
The connection is not being established, has been closed or there was a fatal error.
static inline var CONNECTING : Int
The connection is being established.
static inline var OPEN : Int
The connection is open and dispatching events.
Back | Index