Ajax: invalid XML error



I'm instructed to make an ajax call to read my xml. When I try to do so I get an parsererror.


When I run my xml through a validator, it appears to be correct.


this is my XML:



<?xml version="1.0" encoding="UTF-8"?>

<webservices>
<flickr>
<api>
<key>
***
</key>
<secret>
***
</secret>
</api>
<url>
<api-url>
http://ift.tt/1zxZCJM
</api-url>
<attr>
tags=
</attr>
<attr>
has_geo=1
</attr>
<attr>
per_page=4
</attr>
</url>
</flickr>
</webservices>


ajax request:



var getFlickrApi = function(){

$.ajax({
url: 'assets/xml/config.xml',
dataType: 'xml',
success: handleXML,
error: handleError
});

};

var handleXML = function(data){
console.log(data);
};

var handleError = function(xhr, error, message){
console.log(error, message);
};

No comments:

Post a Comment