jQuery has the $.getJSON() function that I use to load json files from other domains like so:
$.getJSON('http://somesite.com/file.js', function(output) {
// do stuff with the json data
});
I was wondering if I can do the same with xml files from other domains or do I have to use a server side language for that?
This is the xml document I would like to load:
http://google.com/complete/search?output=toolbar&q=microsoft
I agree with @viyancs , simply speaking if you want to get xml of other domain, there is a cross-domain-restriction, the way to solve this is create a proxy, so the request process is:
For more detail have a look at: http://developer.yahoo.com/javascript/howto-proxy.html
BTW: why you dont have to do this for JSON? it is a technique called JSONP.