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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:54:42+00:00 2026-05-27T19:54:42+00:00

I’m trying to use jQuery to make a slightly more sophisticated page refresh. With

  • 0

I’m trying to use jQuery to make a slightly more sophisticated page refresh. With a meta refresh, if a page fails to load once, it won’t load again. I am trying to make something that will repeatedly try to load–if it fails to load once, it will try again the next time so that if the last load is successful I will see a fresh version of the page, whether or not there were intervening faults.

My code at present is:

<script language="JavaScript" type="text/javascript" src="/include/jquery.js">
</script>
<script language="JavaScript">
    var delay=5*1000;
    function load(){
        setTimeout(load, delay);
        jQuery("#content").load("calendar_internal.cgi?days=40", function(){
            jQuery("#preload").hide("slow");
        });
        delay = 15*60*1000;
    }
    jQuery("#content").load("calendar_internal.cgi?days=40", load);
</script>

So far as I can tell, this is functioning as a noop. It doesn’t refresh.

How can I get this to work at least at a basic level so it refreshes but one bad refresh doesn’t mean that I have to reload if I want to see the page at all?

–EDIT–

What I have now is apparently working (after light testing):

<script language="JavaScript">
var placeholder = jQuery('<div></div>');
function load(){
    setTimeout(load, 15*60*1000);
    placeholder.load("logistic_ajax.cgi", function(){
        if (placeholder.html()) 
            jQuery('#content').html(placeholder.html());
    })
}
load();
</script>
  • 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-27T19:54:43+00:00Added an answer on May 27, 2026 at 7:54 pm
    var $placeHolder = $('<div />');
    $placeHolder.load(yourURL,function() {
        if ($placeHolder.html()) {
            $("#content").html($placeHolder.html());
        }
    });
    

    or something like that. This way you are not doing all or nothing type of thing. If something messes up with the HTML coming back, you can check in your “if” condition. Not sure the particulars of the response so you would need to hash that out on your own or let me know more detail.

    Cheers.

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

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I am trying to render a haml file in a javascript response like so:
I want use html5's new tag to play a wav file (currently only supported
In my XML file chapters tag has more chapter tag.i need to display chapters

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.