I’m new to jQuery and would like to parse an xml document.
So far, I’ve been doing:
$.ajax({
url: xmlUrl,
type: 'GET',
dataType: 'xml',
crossDomain: true,
error: function(){
alert('Error loading XML document');
},
success: function(xml) {
}
});
However, I always get the error message in ie8.
Here is the xmlUrl address which I want to parse.
http://api.facebook.com/restserver.php?method=links.getStats&urls=MyUrl
With really no luck. Any ideas? Thanks.
I’m afraid IE 8 does not support Crss Origin requests, hence does not allow the cross-domain request (unless you do not setup the browser itself).
As the service you are trying to use does not use any client’s data, you can setup a proxy – simple PHP script, that retrieves the url and output (via curl or file_get_contents if allow_url_fopen is enabled), and use ajax without the crossdomain.