Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7977073
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T09:05:23+00:00 2026-06-04T09:05:23+00:00

Hope someone can help. I am new to javascript so please forgive any mistakes.

  • 0

Hope someone can help. I am new to javascript so please forgive any mistakes. I am trying to achieve the following:

I have an index page with an html table, split up into four quarters. Each quarter has a DIV ID, and an ajax load via jquery will reload individual DIV’s with a PHP page sucessfully, after a certain delay.

What I am trying to do, is for one of the quarters, rotate three PHP pages in the DIV every 15 minutes, and keep looping. I had setup an array with three php sites in, and sucessfully used this with a counter variable to call the relavent entries in the array via jquery. If I put in the count number in the ajax code it works. I am now struggling to see how I can increment the counter, and also reset it once it has reached the third page.

I do not know if I can use the ajax.complete function to assist, as I dont know if I can put “standard” javascript inside this function.

Thanks for any assistance – my code is below:

var count = 0;
var page = new Array("page1.php","page2.php","page3.php");
var delay = ("9000");


    (
function($)
{
$(document).ready(function()  
{        
$.ajaxSetup(        
    {            
        cache: false


    });  
    var $container = $("#DivID"); 
    $container.load(page[count]);    
    var refreshId = setInterval(function()  
    {           
        $container.load(page[count]); 
    }, delay); 



});

})

(jQuery);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T09:05:24+00:00Added an answer on June 4, 2026 at 9:05 am

    try this

    var refreshId = setInterval(function()  
    {           
        $container.load(page[count]);
        count = (count+1) % 3 
    }, delay); 
    

    This way when count reaches 3 it will be reset to 0. Percent sign is the module division

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I hope someone can help with the following. I'm trying to create a user-specific
I'm new to iPhone development and have a question I hope someone can help
I hope someone can help me with this Javascript. I have an Object called
Google/Bing didnt bring up any solution to my following problem, hope someone can help
I am pretty new to javascript so I hope someone here can help me
I hope someone can help me with the following... I have this code below
I hope someone can help me. I have a website that uses javascript to
hope someone can help. I have two tables: Users -UserID -UserName UsersType -UserTypeID -UserID
I hope someone can help, I am trying to enable enable ASP.Net Impersonation under
hope someone can help. just cannot get a new window to open in Firefox

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.