Cross-site Request
Solution 1:
I'm assuming you mean with Ajax? You can't make cross-site domain requests through normal ajax due to the same origin policy. As such, a script hosted on localhost, can only make requests to localhost.
Now, you can get around this with JSONP, or JSON with padding. This allows you to append a script file to the dom from any source so the code can execute on your site. Personally, I've actually never used it and I understand you have to trust the origin of the script, you don't want arbitrary code being run on your site.
So in a nutshell, if you want localhost to make a request to 'site-2' you need to host a script on 'site-2' that gets loaded by your localhost and makes the request.
Solution 2:
After reading what brad just said, what i would do is to add another chain to the request.
I'll be calling a local serverside
script
(cross domain proxy) that will request and process the data from the other server.
Post a Comment for "Cross-site Request"