R – problem with cross-domain ajax calls


i have two servers a main site and a static server.
i want to get a file's content from ajax in runtime, which is stored in static server.
obviously cross domain problem will occur.

so what i am trying to do is storing that ajax .js in the static server, so that calling the local file wont be a problem.

but after i include that js file from static, still that problem remains…

Any solutions?!

Best Solution

n't use X domain Ajax Requests. Create a "proxy" on your own server (domain) then forward the call to the other domain, cache it, check for security issues and send it back to client again...