I'm trying to get the contents of an xml file using jQuery's ajax function.
$(document).ready(function(){
$.ajax({
url: 'facts.xml',
dataType: 'xml',
success: parseXML
});
function parseXML(xml){
alert(xml.toSource());
//...
}
}
facts.xml is simple:
<?xml version="1.0" encoding="utf-8"?>
<axiom>
<sentence>
<part>something</part>
</sentence>
</axiom>
When I run it in firefox, alert gives me "({})". I've been trying to identify where I was doing wrong, but I couldn't figure it out. Can anyone give me some help?
Thanks a lot!