Dart API Referencedart:htmlEventSource

EventSource Interface

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.

Extends

EventTarget

Constructors

Code new EventSource(String scriptUrl) #

EventSource(String scriptUrl);

Static Fields

Code final int CLOSED #

static final int CLOSED = 2;

Code final int CONNECTING #

static final int CONNECTING = 0;

Code final int OPEN #

static final int OPEN = 1;

Methods

Code void close() #

Closes the connection, if any, and sets the readyState attribute to CLOSED. If the connection is already closed, the method does nothing.
void close();

Code EventSourceEvents get on() #

EventSourceEvents get on();

Code void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) #

void $dom_addEventListener(String type, EventListener listener, [bool useCapture]);

Code bool $dom_dispatchEvent(Event evt) #

bool $dom_dispatchEvent(Event evt);

Code void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) #

void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]);

Fields

Code final String URL #

final String URL;

Code final int readyState #

The state of the connection, must be one of CONNECTING, OPEN, or CLOSED. Read only.
final int readyState;

Code final String url #

Read only.
final String url;

This page includes content from the Mozilla Foundation that is graciously licensed under a Creative Commons: Attribution-Sharealike license. Mozilla has no other association with Dart or dartlang.org. We encourage you to improve the web by contributing to The Mozilla Developer Network.