Link to home
Start Free TrialLog in
Avatar of Bill Sullivan
Bill SullivanFlag for United States of America

asked on

Refresh a portion of a page every 10 seconds

Hi Experts!
I'm trying to get some customer testimonials to "scroll" on the front page of my website by calling survey results from my database.  I would like these comments to scroll every 10 seconds.  Can you help me with the code to do this?  I've included the page I'm working on, and the lines I would like to refresh are found on lines 121 through 165.  Thanks for your help!
index.php
Avatar of Daniel Kline
Daniel Kline
Flag of United States of America image

Use a JavaScript setTimeout() function to wrap the render code which selects the content to display during each interval.

https://developer.mozilla.org/en-US/docs/Web/API/Window.setTimeout
Avatar of Bill Sullivan

ASKER

It appears that code would delay running the script for X seconds, but would not "refresh".  Am I missing how setTimeout() works?
ASKER CERTIFIED SOLUTION
Avatar of Gary
Gary
Flag of Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
There are a lot of discussions on the Internet in how to use setTimeout and its sister setInterval.  The application you are describing is quite common.  See if this solves your problem without having to deal with recursive calls to setTimeout.

http://manos.malihu.gr/slidebox-jquery-banner-rotator/
Thank you so much!