My XMl File
<item>
<title>
<![CDATA[Stanford engineers build a nanoscale device for brain-inspired computing]]></title>
<link>
http://news.stanford.edu/news/2011/july/nano-synapse-computing-061211.html
</link></item>
I am able to fetch easily from link by using the tag
alert(obj.item.link)
Now i want to fetch from the title tag ie.”Stanford engineers build….”
i have tried everything
ie
alert(obj.item.title)
alert(obj.item.title.CDATA);
but none is working , any help
There is a good explanation of how to do this here: http://fczaja.blogspot.com/2007/04/accessing-cdata-section-in-xml-dom-from.html.
However, I’d suggest a jQuery-based solution to hide any browser differences. See this SO question: XML parsing of a variable string in JavaScript.