XMLHttpRequest from remote server
I am currently developing a site, and I need to开发者_C百科 integrate some XML market data a third party is providing. They sent me lots of documents about how to make requests for different types of information, and also how to make a login request. However, my research tells me you cannot use XMLHttpRequest to access data from remote servers unless you are running a proxy, and then the proxy can make the request for you. Also, my understanding is that the third party's logins expire every 24 hours. Can I then have my theoretical proxy automatically renew the login request every day? Sorry if my questions sound dumb -- I am so very new to XML and any help would be appreciated!
Cheers, Jane
Your research is correct. You cannot directly make cross domain requests with XMLHttpRequest. Using a proxy is one solution. Another is to ask the 3rd party to implement JSONP: http://en.wikipedia.org/wiki/JSONP
精彩评论