Minor AJAX Question

Alright well my website has very little desire for ajax, I have a front page with 10 article listings. I use ajax currently to check the database for any new articles and then it reloads the div, that is pretty much the extent of my need. However I would like to put one final touch on it, that being that the div fades in…

xmlHttp.onreadystatechange=function(){
	if(xmlHttp.readyState==4){
		document.getElementById('articles').innerHTML=xmlHttp.responseText;
		setTimeout('Ajax()',5000);
	}
}
xmlHttp.open("GET","http://localhost/articlefeed",true);

So I was curious as to how to get that working, preferably without dabbling into jQuery, but I will if I absolutely have to.

Thanks.

hate to give a lazy answer but seeing as no-one else answered, jquery (as you probably know) is going to really optimize this whole process and make the ajax request and animation a piece of cake.

I appreciate that its beneficial to know how to do it without jquery, but unless you have a compelling reason, I would stick with the easier road.

I’ll have to echo wheeler on this. A javascript framework (such as jQuery) will take care of a lot of the browser inconsistencies and actually prove to be easier than trying to write everything by hand.

http://docs.jquery.com/Tutorials