Lesson 7. Getting the Point Across with Messaging

HTML5 lets you send messages in a cross-window or cross-domain way; we’ll see how that works in this lesson.

Say, for example, that in page A, page B—which comes from the same directory on the server—appears in an <iframe> element. Now you can send text messages from page A to page B and make use of those messages in page B. That’s cross-window messaging.

In fact, page B can come from an entirely different domain and still appear in the <iframe> in page A, and you can still send messages to page A. That’s called cross-domain messaging, and it used to be prohibited, but now you can do it. So even if page B comes from an entirely different server than page A, you can still send page B messages. ...

Get Sams Teach Yourself HTML5 in 10 Minutes 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.