C H A P T E R  6

Using the Communication APIs

In this chapter, we'll explore what you can do with two of the important building blocks for real-time, cross-origin communication: Cross Document Messaging and XMLHttpRequest Level 2 and we'll show you how they can be used to create compelling applications. Both of these building blocks add new communication options to HTML5 applications and allow applications served from different domains to safely communicate with each other.

First, we'll discuss the postMessage API and the origin security concept—two key elements of HTML5 communication—and then we'll show you how the postMessage API can be used to communicate between iframes, tabs, and windows.

Next, we'll discuss XMLHttpRequest Level 2—an improved ...

Get Pro HTML5 Programming, Second Edition 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.