Chapter 4. Messaging: communicating to and from scripts in HTML5

Chapter 4 at a glance

Topic

Description, methods, and so on

Page

Server-sent events Creating events in the browser from the server:  
 
  • Creating an EventSource()
111
 
  • Listening to server events with addEventListener()
111
WebSockets Two-way, event-driven communication:  
 
  • Writing applications using WebSockets
116
 
  • Messaging on the client side
125
Cross-document messaging Communication between scripts in different windows:  
 
  • Sending messages with postMessage()
126
 
  • Receiving messages with onmessage()
126

Look for this icon throughout the chapter to quickly locate the topics outlined in this table.

Get HTML5 in Action now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.