First of all, thanks to Řyvind Kinsey for his great work, who made the job
so easier for cross domain messaging. Even though it remains quite
complicated, you opened a wide way through it ;-)
So let me introduce to you the problem we are actually dealing with :
We have a client that won't let us host our scripts on his domain, and is
therefore pushing us to use this brillant piece of code that is easyXDM. We
already implemented an iframe there a while ago (fetching a page from our
domain, and displaying it in the main section of the website) and are about
to implement a second one which is a widget in the sidebar. As we are using
user authentication and various actions in both iframes (main iframe and
widget), we would like the 2 iframes to communicate with each other and be
able to trigger js events one on the other.
Let me add that their domain is actually calling a script (js) from our
domain as well, which is initializing the widget. So we can execute
We have been trying many different ways to make the 2 iframes communicate
and there are the most advanced (or close to the point) :
- Establishing 2 page<->iframe connections between the main page and both
this is not the best solution ever as it was loading more script to the
initial website (easyXDM, eventually JSON2, flash...) and more importantly,
loaded iframes inside iframes which already contained iframes... a real
mess, occasionnally freezing some browsers. Indeed not the best solution.
- Establishing a direct link between the 2 iframes (even if they are hosted
on the same domain)
easyXDM recognize that they are on the same domain and uses appropriate
not in the iframe displayed. If I trigger a document.createElement, it
would be shown in the iframe displayed, but in the hidden easyxdm's one.
My guess is that they don't find each other, as they are both enclosed in a
page hosted on another domain. Guess the browser can't do that, can it ?
I may add that we are just trying to establish any kind of communication as
we are only dealing with basic actions. We tried implementing easyXDM.Rpc
though, with all (un)success described above. We are currently thinking
about more basic solutions (as window.hash communication) but can't be sure
to get 100% cross-browser compatibility before trying and this is already
taking a lot of time and effort, and we would prefer to go through a tested
Would anyone have a brillant idea on how to make this work ? Or at least
explain what went wrong... I have crawled the easyXDM documentation and the
interesting, more info : http://thirdpartyjs.com/)
Any feedback appreciated, I hope my English was fine and the explanation
too. If anything sounds blurry, please ask.