I am trying to implement a container running under Shindig.

I am having difficulty getting the rpc (Gadget->Contianer) communication 
working.

Here is my simple gadget:

<Module>

  <ModulePrefs title="Hello World">

    <Require feature="rpc" />

  </ModulePrefs>

  <UserPref name="myName" display_name="Name" default_value="Wade" />

  <Content type="html">

<![CDATA[

<script type="text/javascript">

gadgets.rpc.call(null, 'initial_gadget_message', null, 'Hello there! Pre-onload 
message sent successfully.');

</script>

<div id="widgetNode">Hello World</div>

]]>

  </Content>

</Module>

Here is what I have done on the server (adapted)

var id = "gadget_" + (this._static.id++);

gadgets.rpc.register("initial_gadget_message", _messageHandler));

var parent = window.location.origin; // also tried window.location.href

iFrameNode.src = obj.iFrameUrls["default"] + "#parent=" parent + 
"&rpctoken=12345";

iFrameNode.id = id;

gadgets.rpc.setupReceiver(id);

The container is at port 80, the gadget is at port 8080, on the same server 
(localhost)
The gadget loads in the container, but most of the time produces this message, 
sometimes, vary rarely, it will not produce the message.

No relay set (used as window.postMessage targetOrigin), cannot send 
cross-domain message

Any help is appreciated, thanks
--
Wade Girard | Principal Software Engineer
Calabrio, Inc. | 400 1st Avenue N, Ste 300 | Minneapolis, MN 55401
Phone: 763.795.7798

Reply via email to