Archive for May, 2009

Get Rss data using javascript

Posted on May 27, 2009. Filed under: Asp.net | Tags: |

Place bellow script in header part
for javascript file go to http://jquery.com
<script src=”js/jquery-1.2.6.min.js” type=”text/javascript”></script>
<script type=”text/javascript” language=javascript>
$(document).ready(function() {
$.ajax({
type: “GET”,
url: “http://yourdomain.com/rss.xml”,
dataType: “xml”,
success: function(xml) {
$(‘#update-target’).empty();
var str=””;
$(xml).find(‘item’).each(function(){
var title = $(this).find(‘title’).text()
var link = $(this).find(‘link’).text()
var desc = $(this).find(‘description’).text()
str +=”<tr><td><a href=’”+link+”‘ >”+title+”</a><br />”;
str+=”<a href=’”+link+”‘ >”+desc.substring(0,100)+”…</a></td></tr>”;
}); //close each(
$(‘#update-target’).html(str);
}
}); //close $.ajax(
$(“#msg”).ajaxError(function(event, request, settings){
$(this).append(“Error requesting page ” + settings.url + “”);
});
}); //close $(
</script>
Place bellow html part [...]

Read Full Post | Make a Comment ( 1 so far )

    About

    Hi,I am Suresh Sharma from Gorakhpur , UP, India.I have work on .net technology from 2 years. Key skills-Asp.net 2.0,3.5, Sql 2005,2000. Ajax.net 1.1,C#.net

    RSS

    Subscribe Via RSS

    • Subscribe with Bloglines
    • Add your feed to Newsburst from CNET News.com
    • Subscribe in Google Reader
    • Add to My Yahoo!
    • Subscribe in NewsGator Online
    • The latest comments to all posts in RSS
    • Subscribe in Rojo

    Meta

Liked it here?
Why not try sites on the blogroll...