Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing easyXDM to communicate between parent document and child iframe loaded from a different domain (amazon)
    primarykey
    data
    text
    <p>I'm trying to use easyXDM to communicate between parent document and child iframe (loaded from a different domain - amazon). The iframe src is an oauth signed url and has the following code to communicate with the parent document that loads it:</p> <pre><code>socket = new easyXDM.Socket({ remote: "http://localhost:56789/hitch.html", /* parent document */ remoteHelper: "http://localhost:56789/easyXDM/name.html", onMessage: function(message, origin){ alert("Received '" + message + "' from '" + origin + "'"); }, onReady: function() { socket.postMessage("Yay, it works!"); } }); </code></pre> <p>the above code is kept in the head portion of the document.</p> <p>In parent (hitch.html):</p> <pre><code>var transport = new easyXDM.Socket(/** The configuration */{ local: "/easyXDM/name.html", swf: "/easyXDM/easyxdm.swf", onMessage: function(message, origin){ transport.postMessage("This is a message received from " + location); } }); </code></pre> <p>When I load the child iframe from amazonS3 inside the parent document, easyXDM is creating another iframe inside the child iframe with src set to "http://localhost:56789/hitch.html?xdm_e=..." . This causes the whole thing to be repeated in a cycle - with parent again trying to load the child iframe and so on.</p> <p>I'm testing on Firefox 9.0 which has postMessage support. The actual messages are being sent properly and I can see the message boxes. Other than this, it also throws a "url is undefined or empty" error in parent document when initializing easyXDM.socket but it doesn't seem to affect anything else...</p> <p>Thanks,</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload