HTML and CSS Reference
In-Depth Information
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 addEventListen-
er()
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.
This chapter covers
• Server-sent events and event-driven communications from the server
• WebSockets for bidirectional, event-driven communication
• Client-side messaging between pages from different domains
 
Search WWH ::




Custom Search