×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Refresh Page Sections with AJAX

Refresh Page Sections with AJAX

Refresh Page Sections with AJAX

(OP)
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!

RE: Refresh Page Sections with AJAX

Hi

Quote (dfrazell):

I tried using SetInterval for each item in the the dashboard page header but only one of 6 fires.
Using setInterval() 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.
http://rootshell.be/~feherke/

RE: Refresh Page Sections with AJAX

(OP)
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>

RE: Refresh Page Sections with AJAX

Hi

Quote (dfrazell):

I determined my problem was all the page interval times were a multiple of the Page1 interval time.
Probably because the variables used in loadPage() are not declared as local.
 

Feherke.
http://rootshell.be/~feherke/

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close