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!
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.
Avatar of Bill Sullivan


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

Link to home
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.
Thank you so much!