Javascript Ajax RSS Ticker
March 30th, 2006
I get a lot of requests for Ajax Ticker and BBC TIcker and most of the tickers ive done are either in c# or java so I thought I would knock up a simple ajax/js ticker which people can simply add into a website.
Building this type of ticker is split into three small parts. The first is to create a server side file that can grab a remote RSS XML feed. Ajax doesnt want you to access remote URLS which are not part of your domain, for security reasons. As such we need to create a very small server side file that can act as a proxy between your domain and the RSS feed you want, e.g.
Ajax Requests BBC News Feed -> A serverside file (e.g. php) is called on your domain -> This requests the BBC feed and hands it back to the ajax caller
To sum it up, whilst you are getting a remote feed it appears to ajax as though its coming from the local domain.
The second stage is to create the two portions of javascript we’re going to need. We need an ajax processor to obtain and process and RSS feed and we need a controller to handle the ticker aspect.
Third stage is the HTML, this is really simple and essentially you setup the correct elments and call the javascript file.
I’ve put all the files you need in this all in one ajax ticker file (rar)
Also, you can view a live example of the Ajax RSS Ticker using the BBC News Feed.
Entry Filed under: Technology
Leave a Comment
Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>
Trackback this post | Subscribe to the comments via RSS Feed