[ACCEPTED]-How to control one window from another in HTML5?-postmessage

Accepted answer
Score: 11

You don't need any HTML5-Features for that 13 but you can easily do it with javascript:

myNewWindow = window.open() opens 12 a new window and assigns a window-object of that 11 new window to myNewWindow, so you can easily access 10 the new window's DOM from the opening script, using 9 the myNewWindow-variable.

It also works the other way: In 8 a script in the new window, you can user 7 window.opener to access the window-object and DOM of the opening 6 window.

Just make sure, that the content 5 of all your windows is loaded from same 4 domain, as javascript does not allow you 3 to control content loaded from another source 2 (refer to "same origin policy" for more 1 information on this topic).

Score: 4

This answer is 6 months late, but for the 9 Googlers (like me):

I would recommend WebSockets 8 for what you're trying to do Jonathan. WebSockets 7 allow the server to broadcast data to any/all 6 browser windows that are open for your page/site 5 in realtime.

Browser support is currently 4 quite poor but there are good shims to get it working 3 across all browsers very efficiently. Socket.io is 2 one such solution which I've used to great 1 success.

More Related questions