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 ...