Just add this to your site, give the element you want to hold your RSS the id of "holder" and then change the Javascript variable in the getRSS() function to that of the RSS feed you want to parse on your site/page.
It is currently set up to take a click event (the link in the DIV at the bottom) before loading the RSS information.
<script>
var xmlHttp;
function getRSS(){
xmlHttp=GetXmlHttpObject();
if(xmlHttp == null){
alert("Your browser does not support AJAX!");
return;
}
var url = "http://www.dreamincode.net/rss/forums.php?forum=1";
xmlHttp.onreadystatechange = stateChanged;
xmlHttp.open("GET", url, true);
xmlHttp.send(null);
}
function stateChanged(){
obj = document.getElementById("holder");
obj.innerHTML = "";
if(xmlHttp.readyState == 4){
var xmlDoc = xmlHttp.responseXML.documentElement.getElementsByTagName("item");
// alert(xmlDoc.getElementsByTagName("item")[0].childNodes[1].nodeValue);
for(var i=0; i<xmlDoc.length; i++){
obj.innerHTML += "<div class='RSS_feed_item'><span class='RSS_feed_title_bar'><a class='RSS_feed_title_link' href='" + xmlDoc[i].getElementsByTagName('link')[0].childNodes[0].nodeValue + "'>" + xmlDoc[i].getElementsByTagName("title")[0].childNodes[0].nodeValue + "</a></span><br/><span class='RSS_feed_description'>Posted on " + xmlDoc[i].getElementsByTagName('pubDate')[0].childNodes[0].nodeValue + ", by " + xmlDoc[i].getElementsByTagName('author')[0].childNodes[0].nodeValue + " in "+ xmlDoc[i].getElementsByTagName('category')[0].childNodes[0].nodeValue + "<br/>" + xmlDoc[i].getElementsByTagName('description')[0].childNodes[0].nodeValue + "</span></div>";
}
}
}
function GetXmlHttpObject(){
var xmlHttp=null;
try{
xmlHttp = new XMLHttpRequest();
}
catch(e){
try{
xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e){
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}
</script>
<div id="holder">
<a href="javascript:getRSS()">Click Me</a>
</div>