An example application


show more An example application provides you with in-depth training on Developer. Taught by Bill Weinman as part of the HTML5: Messaging and Communications in Depth show less
please wait ...

An example application

This is a simple example application that implements cross-origin messaging using the HTML5 messaging API. So you can see we have two documents loaded up: one outside and one inside a frame. And again, because Internet Explorer won't even do this if they're in separate tabs, I've had to use frames for all of these examples. But just know that you can do exactly the same thing in tabs if you're using Firefox or Chrome or Safari or any other browser. But that doesn't work in Internet Explorer.

So the way I have this set up is that these two documents are hosted on a server where the same file system is accessible from different domains, and so they're effectively in two different domains, at least from the perspective of the browser. And so the browser has its same origin policy in place and it's treating these as being from two separate origins. So the outer document is on a host called one.3sn.net, and the inner document is on a host called two.3sn.net.

And you&...

An example application
Video duration: 5m 10s 43m 19s Intermediate

Viewers:

An example application provides you with in-depth training on Developer. Taught by Bill Weinman as part of the HTML5: Messaging and Communications in Depth

Subjects:
Developer Web
Software:
HTML
Author:
please wait ...