O'Reilly logo

Pro HTML5 Programming: Powerful APIs for Richer Internet Application Development by Frank Salim, Brian Albers, Peter Lubbers

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 5. 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 version ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required