Stats

120 Contributors: 2 Monday, September 5, 2016
Licensed under: CC-BY-SA
Not affiliated with Stack Overflow
Rip Tutorial: riptutorial@gmail.com
Roadmap: roadmap

Server-sent events

Syntax

  • new EventSource("api/stream");
  • eventSource.onmessage=function(event){}
  • eventSource.onerror=function(event){};
  • eventSource.addEventListener=function(name, callback, options){};
  • eventSource.readyState;
  • eventSource.url;
  • eventSource.close();

Related Examples