How to get HTML elements, content or parameters from JSON object
This question already has an answer here:
try using
result.rss.channel.item[0].description
because from the example it looks like item is an array of objects.
You can do this with jQuery.
var $div = $('<div/>').html(obj.rss.channel.item[0].description);
var $img = $div.find('img')
$scope.imgSrc = $img.attr('src')
http://jsfiddle.net/h6mp1o56/
[Updated: Without jQuery]
var div = angular.element('<div/>').html(obj.rss.channel.item[0].description);
var img = div.find('img')
$scope.imgSrc = img.attr('src')
http://jsfiddle.net/h6mp1o56/1/
链接地址: http://www.djcxy.com/p/31736.html上一篇: json字符串到javascript对象