Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Refresh Page Sections with AJAX

Status
Not open for further replies.

dfrazell

IS-IT--Management
May 26, 2005
65
0
0
US
I have a dashboard application using AJAX to build and display 5 or 6 tables of information. Each dashboard item can be refreshed independently of the other items, via a refresh button, without refreshing the entire page. How can I make these items refresh automatically at different intervals? I tried using SetInterval for each item in the the dashboard page header but only one of 6 fires. The others items don't refresh. In fact the only one that refreshes is the one with the shortest interval time.

Thanks!
 
Hi

dfrazell said:
I tried using SetInterval for each item in the the dashboard page header but only one of 6 fires.
Using [tt]setInterval()[/tt] is the way to do. Certainly you did something wrong. If you post your code or the URL of that page, we can help, otherwise not.

Feherke.
 
I got it working with one potential problem. I determined my problem was all the page interval times were a multiple of the Page1 interval time. I've now staggered the interval times.
The potential problem would be if my setInterval times are a multiple of one another causing them to fire at the same time. Is there a better way to handle this?

My interval times are pretty short here for testing purposes. My actual times will be more like 15 to 20 minutes.

Code:
//Original Code
<html> 
 <head> 
 <script language="JavaScript">
    setInterval("loadPage('Page1');", 50000);
    setInterval("loadPage('Page2');", 100000);
    setInterval("loadPage('Page3');", 150000);
    setInterval("loadPage('Page4');", 200000);
    setInterval("loadPage('Page5');", 300000);

 </script>
</head>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top