I'm trying to use Prototype's Ajax.PeriodicalUpdater to scroll through/display an array of items on an interval. So far I've managed to make it display a new item every 2 seconds, but it only works in Firefox. Haven't tested in Safari or Opera yet...but I know it doesn't work in IE6. It can be seen below here:

http://squarebox.org/sandbox/comment_slide/

on the index.php page, I have this script written:

Event.observe(window, 'load', function() {
	new Ajax.PeriodicalUpdater('comment_slider', 'comment_slider_ajax.php', {
		method: 'post', 
		frequency: 2,
		onSuccess: function(){ new Effect.Fade('comment_div', { duration:0.3 }) },
		insertion: 'top',
	});
});

function showComment(divId){
	new Effect.SlideDown(divId, { duration:0.3 });
}

showComment() is called in comment_slider_ajax.php, which displays the "comment_div" and calls the showComment() function.

I've searched through some similar issues -- some people seem to experience it, but others confirm that it's working. I've seen some users say that the object only fires the AJAX request once, then stops working.

Anyone have any ideas?

Queries related to Javascript libraries like Prototype are better asked in the specific forums (unless you already haven't asked it there!) since there might be many out there who would have faced a similar problem and hence is one of the fastest way of getting help.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.