你得绕过去
data.items
并将目标数据添加到html中。如下图所示
$.each(data.items, function(i, item){
$("#feed").append('<div class="item"><img src="'+item.thumbnail+'"/><span class="image-title">'+item.thumbnail+'</span></div>');
});
var url = 'http://www.recruiter.com/feed/career.xml';
$.ajax({
type: 'GET',
url: "https://api.rss2json.com/v1/api.json?rss_url=" + url,
dataType: 'jsonp',
success: function(data) {
$.each(data.items, function(i, item){
$("#feed").append('<div class="item"><img src="'+item.thumbnail+'"/><span class="image-title">'+item.thumbnail+'</span></div>');
});
}
});
demo