why [object HTMLImageElement] is displayed ? not <img>?

lorelei

New Member
I try to parse rss feed from a tumblr blog.this is a snippet of the xml from rss feed.\[code\]<item> <title>title goes here</title> <description> <img src="http://media.tumblr.com/ajfafh.jpg"/> <p>text description goes here</p> </description> . .</item>\[/code\]i try this code to get img tag within description tag\[code\]function parse(xml){ xml.find('item').each(function(index){ var $item = $(this); var df = $item.find('description')[0].textContent; var $asdf = $(df).find('img').first()[0]; var item = { index: index, description: $item.find('description')[0].textContent, img: $asdf } console.log(item.img);// return exactly the img tag just like what i want <img> // i also try this one console.log($(item.description).find('img').first());// return [<img src />] this.container.append(Mustache.to_html(this.template, item)); //this.container = $('#container') //this.template = $('#template') });}\[/code\]i use mustache.js to load it to html.the HTML\[code\]<ul id="container"> <script id="template" type="text/template"> <li>{{img}}</li> </script></ul>\[/code\]but when i run it on browser it returns [object HTMLImageElement], while console.log() returns correct value.why is that happen? what did i miss?
 
Back
Top