$.ajax({
type: 'GET',
url : 'http://themeforest.net/feeds/items/3042144.atom',
dataType : 'xml',
error: function(xhr) {
console.log('Failed to parse feed');
},
success : function(data) {
var obj = $.parseXML(data);
}
});
With this setup I'm getting the error message "Failed to parse feed"
When I change the dataType to text instead of xml, I successfully fetch the feed, but then $.parseXML throws error in the console:
[ERROR] 21:27:34 Error
Error: Invalid XML: <?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
<id>tag:themeforest.net,2007-12-31:/feeds/items/1358600</id>
...
...
What am I doing wrong here? I tried googling about it, but couldn't find a similar issue. Any ideas?
Kind of obvious solution, the data variable was already an xml object, so I could traverse it with jquery:
$(data).find('entry').find('author').text();