Reputation: 59
Is it possible to have a RSS feed by using a Javascript code?
Upvotes: 2
Views: 2575
Reputation: 6438
look at this jQuery plugin. It works great
http://www.zazar.net/developers/jquery/zrssfeed/
Upvotes: 0
Reputation: 40784
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.
Upvotes: 2
Reputation: 7365
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;
}
});
Upvotes: 1
Reputation: 8187
An RSS feed is a type of xml file at a url. I'm not sure how you'd accomplish that with javascript (unless it's server side javascript). I think you need to do some homework on what you are trying to accomplish.
Upvotes: 1