Can I make an XMLHttpRequest to another domain? Can I make an XMLHttpRequest to another domain? xml xml

Can I make an XMLHttpRequest to another domain?


Nope, not right now. I believe I read that plans/design's are in the works by standards groups for the future, so we can securely do this.

Cross site scripting vulnerabilities would be rampant other wise.

JSONP is a possible solution if the other sites API supports.


HTML5 now supports Cross Origin requests with XmlHttpRequest level 2 take a look at :

http://www.html5rocks.com/en/tutorials/cors/


It's a security issue, most (all?) browsers won't let you do that. You can use a hidden IFrame to do your fetching, but it's complex enough that i'd just use a server (or switch to a different language, if i don't have to run in a browser)