I am doing a prototype that will fetch a variety of XMLs from a web resource location and then display them on the DOM.
Here is the function
function readXML()
{
$.ajax({
type: "GET",
url: "https://collaboratewiki.com/wikiattachments/61736956/engineer.xml",
dataType: "xml",
success: function(xml)
{
window.alert("success")
},
error: function(xhr,err)
{
alert("readyState: "+err.readyState+"\nstatus: "+err.status);
alert("responseText: "+err.responseText);
}
});
}
When I call this function it goes to the error case but I get “Undefined” in my message output.

I need to find out why I can’t fetch my XML but with this output its not helpful at all.
How do I get all the details of the error that is happening with the AJAX call?
I have tried instead of “err.responseText” , “xhr.responseText” but I still get the undefined.
Thanks
From the documentation:
The second and third arguments are strings, not objects, so they won’t have additional properties on them. Some of the ones you’re trying to get (such as
readyState) will be available from thexhrobject in your code, rather than fromerr(which is just a string).You may want to try something like this: