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 7629143
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:45:32+00:00 2026-05-31T05:45:32+00:00

So i have looked around and most of the code for this looks needlessly

  • 0

So i have looked around and most of the code for this looks needlessly beefy. I am looking for lightweight ajax code that refreshes a div with an action like:

load('boo.php')

And I need it to load first on the page opening (ie no delay) then every x seconds refresh (without fade) so you cannot notice a change unless my Database rows have updated but I can do the db bit.

I think i would need something like:

onreadystatechange

to load when the page loads? Eh im not too sure on this 🙁 any help would be much appreciated!

Thanks!

  • 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-05-31T05:45:33+00:00Added an answer on May 31, 2026 at 5:45 am

    I totally recommend using some library for cross-browser support and tested code, e.g. jQuery.

    With jQuery, it’s as simple as

    $.get('boo.php', function(data){$('#divId').html(data);});
    

    You can wrap this in a function and call it on document ready, then use setInterval as suggested by @M1K1O

    Update
    To run the code when the DOM is loaded, the jQuery API documentation for ready states that

    All three of the following syntaxes are equivalent:

    • $(document).ready(handler)
    • $().ready(handler) (this is not
      recommended)
    • $(handler)

    Here is a complete example:

    function refreshDiv()
    {
        $.get('boo.php', function(data){$('#divId').html(data);});
    }
    $(function()
    {
        refreshDiv();
        setInterval(refreshDiv, x * 1000); // x is the number of seconds
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have looked around on Google and StackOverflow for the answer to this question,
I have looked around here and the Internet in general but it seems this
Sorry if this is obvious but have looked around and can't get this working:
I looked around but haven't found an answer to this. I have a CentOS
I have looked around, but most of them don't make any sense. Some have
I have looked around for quite some time trying to get openCV installed. I'm
I've got zero experience with Python. I have looked around some tutorial materials, but
I have looked all around and only found solutions for python 2.6 and earlier,
I've looked around and have bits and pieces but can't put the puzzle together.
I've looked around but have yet to find a great solution the the following

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.