views:

1194

answers:

5

If there anyway allows AJAX between two own domains without proxy hacking, JSONP, Flash or browser security changes? Maybe SSL or something?

+2  A: 

A signed Java applet might be able to do it, but that is the same principle as Flash so probably would not meet your requirements.

There is a specification for cross domain requests, but it is still in the development stages.

David Dorward
Yes, java applet is not a choice.
kingoleg
And thanks for Cross-Origin Resource Sharing link
kingoleg
+1  A: 

As far as I know, your best bet here is to create a server resource that you can direct your AJAX calls to that will forward them on to the second server on a different domain and then tunnel the results back to your application.

Mike Clark
+1  A: 

You could try a technique known as 'Ajast'.

Basically your javascript on domain A adds additional <script> tags as needed to the page. These script tags point to javascript files on domain B (which need not be static .js) allowing you to load data from domain B.

EoghanM
AKA JSONP - http://en.wikipedia.org/wiki/JSON#JSONP - which was mentioned as being unacceptable.
David Dorward
+1  A: 

On the couple of occasions where I've had a similar need to work cross-domain I've sidestepped it by using an embedded borderless iframe of the same color as the embedding page. It's an old technique, predating widespread AJAX use and is often overlooked nowadays because of the 'we'll use AJAX' mindset. you can however do quite a lot with this approach and it might suffice if you are truly stuck. Certainly you can code some quite complex interactions between the embedded and main pages which can give, to some extent, a similar user experience to an AJAX-enabled page.

One obvious thought that does occur though, and one I have never tried - is it possible to embed an iframe for the second domain inside the main page (i.e. the first domain) and communicate from the main page to the second domain via the embedded iframe?

Cruachan
A: 

Just use easyXDM, it allows for easy communication between documents of different domains. Take a look at one of the examples, http://consumer.easyxdm.net/current/example/methods.html

Sean Kinsey