[Dojo-interest] Dojo cross-domain communications (iframe)

Victor Danilchenko victor at askonline.net
Tue Jun 22 14:18:51 EDT 2010


On 6/22/10 1:25 PM, Dustin Machi wrote:
> This will work for you I believe. http://www.sitepen.com/blog/2008/07/22/windowname-transport/
>
> Dustin
>
> http://www.sitepen.com/blog/2008/07/22/windowname-transport/

	Whew! This did indeed do the trick, with the caveat that the container 
cannot read the iframe.contentWindow.name, but iframe can set 
parent.name. Got the basic solution working already... What a load off 
my shoulders!

	Thanks a lot, everyone who has spoken up. You have been most helpful.

> On Jun 22, 2010, at 1:22 PM, Victor Danilchenko wrote:
>
>> On 6/22/10 10:07 AM, Stefano Gargiulo wrote:
>>> what do you need excactly?
>>> 1) cross-domain ajax requests?
>>> 2) operating with a real iframe document dom?
>>>
>>> for 1) see dojo.io.script and jsonp
>>> for 2) wait html5 and the allow-same-origin attribute in iframes.
>>
>> 	Unfortunately, I need #2 -- communication between frames with different
>> origins. This is due to a single-domain license we have on one component
>> of our product (the product is spread across multiple domains which
>> share common server resources). We load this licensed component in an
>> iframe, but for one particular feature, it has to communicate with the
>> container page.
>>
>> 	I have already implemented a dual-prong solution (URL fragments or
>> postMessage, depending on the capability test results), only to discover
>> that my very, very favorite browser -- IE7 -- does not support either
>> method. Ugh, how I hate it...
>>
>> 	I googled it, and found some information on IE7 policy settings
>> pertaining to the cross-domain frame navigation. However, this doesn't
>> help me -- with that flag enabled, I still can't access
>> iframe.contentWindow.location -- and anyway, we can't expect our users
>> to follow non-trivial instructions on managing IE security policy.
>>
>> 	The obvious solution would be to scrap the whole thing and use a common
>> server endpoint for communicating between the frames, but that would be
>> a rather more complicated solution to implement; and if there's one
>> programmer's virtue I possess in abundance, it's laziness.
>>
>> 	Does anyone know of some IE7 hack for communicating between
>> different-origin frames?
>>
>> 	Thanks in advance guys, you have been most helpful this far.

-- 
	Victor Danilchenko
	Senior Software Engineer, AskOnline.net
	victor at askonline.net - 617-273-0119


More information about the Dojo-interest mailing list