# Making an AJAX request every few seconds

**URL:** <https://www.ruby-forum.com/t/making-an-ajax-request-every-few-seconds/104751>\
**Category:** Rails\
**Created:** [May 22, 2007, 4:24am UTC](https://www.ruby-forum.com/t/making-an-ajax-request-every-few-seconds/104751 "2007-05-22T04:24:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrew](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f19dbf/32.png) [@andrew](https://www.ruby-forum.com/u/andrew)\
**Post date:** [May 22, 2007, 4:24am UTC](https://www.ruby-forum.com/t/making-an-ajax-request-every-few-seconds/104751/1 "2007-05-22T04:24:39Z")

</div>

I’m working on a project and I need to change a group of images every  
5-10 seconds. It could be easily done with Flash, but I want to try and  
find a way to do it using Javascript and AJAX.

Is there a way to call an RJS script every x seconds?

Thanks,

Andrew

---

<div class="post-metadata">

**Author:** ![andrew](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f19dbf/32.png) [@andrew](https://www.ruby-forum.com/u/andrew)\
**Post date:** [May 22, 2007, 4:26am UTC](https://www.ruby-forum.com/t/making-an-ajax-request-every-few-seconds/104751/2 "2007-05-22T04:26:38Z")

</div>

Andrew wrote:

> I’m working on a project and I need to change a group of images every  
> 5-10 seconds. It could be easily done with Flash, but I want to try and  
> find a way to do it using Javascript and AJAX.
> 
> Is there a way to call an RJS script every x seconds?
> 
> Thanks,
> 
> Andrew

Nevermind this. I found periodically\_call\_remote right after I  
submitted this question.
