Is it possible to have a RSS feed by using a Javascript code?
-
2Are you talking about writing to one or reading one?Jamie Wong– Jamie Wong2010-08-18 15:02:56 +00:00Commented Aug 18, 2010 at 15:02
-
1What is the question exactly? You want to parse/display a RSS feed using javascript? Or deliver your content using Javascript. The second is not possible completely using just javascript.Teja Kantamneni– Teja Kantamneni2010-08-18 15:04:23 +00:00Commented Aug 18, 2010 at 15:04
-
@Teja: Not possible with clientside javascript.Jamie Wong– Jamie Wong2010-08-18 18:18:32 +00:00Commented Aug 18, 2010 at 18:18
5 Answers
It is totally possible.
If you want to use a local feed (on your own domain), you can simply use AJAX and parse that RSS feed.. This does not, however, work cross-site (as you might know), and unfortunately you cannot use this to get RSS feeds from other domains. (If you don't know AJAX, you can learn it at W3Schools or Tizag).
But Google has a solution. Using the Google AJAX Feed API, you can read RSS feeds from other domains without AJAX. You can read the docs for it to get a basic understanding of how it works.
Comments
It's entirely possible. Create an Ajax request with JQuery.
$.ajax({
type: "GET",
url: "[your xml rss url]",
dataType: "xml",
success: function(x) {
$(x).find('foo').children().each(function(){
if(this.nodeName == "bar")
{
var x = $(this).attr("bar1");
var y = $(this).attr("bar2");
var z = $(this).attr("bar3");
return;
}
});
Comments
That depends what you mean. Probably not.
1 Comment
look at this jQuery plugin. It works great