<!-- http://www.abc.com -->
<rss version="2.0">
<channel>
<title>SENSEX view</title>
<link>http://www.abc.com</link>
<copyright>Copyright 2009, abc</copyright>
<item>
<title>
<![CDATA[ SENSEX : 20263.71 * -382.93 (-1.85 %) ]]>
</title>
<link/>
<pubDate>9/20/2013 4:00:00 PM</pubDate>
<author>abc</author>
<guid/>
</item>
</channel>
</rss>
I want to extract "<![CDATA[ SENSEX : 20263.71 * -382.93 (-1.85 %) ]]>" from above XML data in a variable. I am not familiar handling XML using javascript. So i need some help or suggest me some tutorials ??
Here's what i have got :
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" ></script>
<script>
$(document).ready(function(){
$.ajax({
type: "GET",
url: "http://rss.xml",
dataType: "xml",.find("title")
success: function(xml) {
$(xml).find("title").each(function(){
var title = $(this).find('title').text();
$(this).find('title').each(function()
{
alert(title );
});
});
}
});
});
</script>
</head>
<body>
</body>
</html>
.find("title")titleelement present withineachitemelement. There are clues there :)