Because of the cross domain security restrictions in most Javascript implementations, it’s normally impossible for one HTML document to communicate with another frame, popup, or iframe unless the two pages are served from the same domain. James Burke came up with a clever solution to this problem, allowing bidirectional communication between a parent window and it’s iframe or popup.
The trick is to use the fragment identifier, that portion of the url after the # which is normally used to identify a named anchor, to pass messages between the documents. Since the javascript in both documents can retreive the other window’s location, and since changing the location to a new anchor doesn’t involve a page refresh, the two windows can talk to eachother. It’s as simple as setting an interval on each end to poll the other window’s location for changes.
Cross Frame Communication with Fragment Identifiers – Link and an Example

RSS for MAKE
this works! I would kiss you if you weren’t infected with parasites.
Works as long as you don’t care about the back button.
The back button no longer works as expected.. each time you change the hash “#” value to send messages, an entry is made to the browsers history. Hitting the back button sends the page back thru these messages, confusing the user.
Similar issue with the forwards button.
Works as long as you don’t care about the back button.
The back button no longer works as expected.. each time you change the hash “#” value to send messages, an entry is made to the browsers history. Hitting the back button sends the page back thru these messages, confusing the user.
Similar issue with the forwards button.
Follow MAKE
From the Maker Shed
Launch Price: $9.99
Make: School’s Out! Summer Fun Guide
This Summer Fun Guide is brimming with over 50 projects for kids of all ages. You’ll also find inspiring young maker profiles, as well as tool reviews written for and by kids! Plus, it’s our 3D issue, complete with 3D glasses and tons of super-cool 3D photos!
Read More →