Wednesday, May 27, 2009

Get Rss data using javascript

Place bellow script in header part

for javascript file go to

<script src="js/jquery-1.2.6.min.js" type="text/javascript"></script>
<script type="text/javascript" language=javascript>
$(document).ready(function() {

type: "GET",
url: "",
dataType: "xml",
success: function(xml) {
var str="";


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(
}); //close $.ajax(
$("#msg").ajaxError(function(event, request, settings){
$(this).append("Error requesting page " + settings.url + "");

}); //close $(


Place bellow html part in body tab

[sourcecode language="html"]

<Table id='update-target'>

<div id=msg></div>

1 comment :

  1. I'm getting "Error requesting page "
    and isn't the link xml because I have tried with others urls


AJAX, asp,, and sql server security, IntemIndex, C#, Css, DataBinder.Eval, DataKeyNames, Datalist, Datapager, DataSet, DataTable, DropDownList, FindControl, gridview, JavaScript, jquery, Listview, Paging, Regex, RegularExpression, Repeater, Server side validation, Sql Server, timer, timercallback, Validation, XML, xmlnode, XPath