Click to See Complete Forum and Search --> : cross domain communication issue


devanand76
12-26-2008, 12:27 PM
Hi,

Let me first give a bit background before putting the problem.

I am using IIS 5.1, ASP.NET 2.0. C#, javascript, prototype. As per the requirement I have to develop cross domain communication.

What I am trying to do is from one domain I need to pass some info to another domain. For Ex. I open up google.com and I open a child window through "window.open" javascript function which open another site, say yahoo.com. Now when I search something (say "abc") in google.com I need to pass that info/event to the child window (here it is yahoo.com) programmatically.

I found 2 options so far.
a) refresh the client page with the querystring ie., www.yahoo.com?request=abc (not accepted solution to our clients).
b) pass data in url as hash (#), but the drawback in this method is I have to poll the URL in a loop which is also not accepted by our clients.

Is there any other option or anything that we can use to do cross domain communication. I have access to both domains and can make any changes to client or server.

I searched across the forum and was not able to find something related to this. Thanks a lot in Advance for the help. I am really stuck over here.

Thanks.

felgall
12-26-2008, 02:52 PM
Use server side processing on the two domains to pass the information from the one to the other. The cross domain restriction only applies client side so using ajax to pass the request to the server and server side processing to then retrieve the information from the other domain will work.

devanand76
12-26-2008, 03:50 PM
Thanks felgall,

Sorry for my lack of knowledge. But I am not able to get the second part.

"The cross domain restriction only applies client side so using ajax to pass the request to the server"
Fine, I can make the ajax call to the server to update the info in the server for 1st domain.

"and server side processing to then retrieve the information from the other domain will work"

I am not able to get this part. Does this means the server in 2nd domain has to poll the other server in the 1st domain ?

If you can provide some more info or example or links that would be very very helpful. Thanks again for taking out the time.

devanand76
12-28-2008, 10:48 PM
Hi felgall,
Can you please help.

Thanks,

felgall
12-29-2008, 05:00 PM
With the various languages you are using to build the application the one you'd use to do the call to the other domain to retrieve the required info would be c#.

For the web page to interactively access the information from the other domain the JavaScript would use the Ajax calls within prototype to call the c# module that would in turn retrieve the required info from the other domain and pass it back to the page.

devanand76
12-29-2008, 08:02 PM
Thanks a lot.
Dev