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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:41:01+00:00 2026-05-28T13:41:01+00:00

I have some images loading from offsite and have no control over their availability.

  • 0

I have some images loading from offsite and have no control over their availability. I’ve found that under heavy load they are sometimes failing to load, but on a quick refresh they’ll show right up.

Is there a way to detect if images fail to load and then if so, evoke a reload on the img src until it loads? If so, could you please provide an example?

  • 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-28T13:41:02+00:00Added an answer on May 28, 2026 at 1:41 pm

    Here something I compiled which might help. I couldn’t manage to do testing of this please let me know if you are having any issues.

    $(function() {
       var $images = $('img.imageClassUpdateAtInterval:not([src="/assets/spinner.gif"])');
    
      // Now, no such image with
       // a spinner
       if($images.length === 0 && window.imageLocator)
         clearInterval(window.imageLocator);
    
    
        window.imageLocator = setInterval(function() {
            $images.each(function() {
                $this = $(this);
                if (!$this.data('src')) {
                    $this.data('src', $this.prop('src'));
                }
    
                $this.prop('src', $this.data('src') + '?timestamp=' + new Date().getTime());
                console.log($this.prop('src'));
            });
        }, 60 * 1000);
    
       // suppose, an error occured during
       // locating the src (source) of the
       // image - image not found, network
       // unable to locate the resource etc.
       // it will fall in each time on error
       // occurred 
       $('img.imageClassUpdateAtInterval').error(
              function () {   
                     // set a broken image
                     $(this).unbind("error").attr("src", "/assets/broken.gif"); 
                     // setting this up in relative
                     // position
                     $(this).css("position", "relative");
                     $(this).apppend("<span>Error occured</span>");
                     $(this).find("span").css({"position": "absolute", "background-color": "#252525", "padding": ".3em", "bottom": "0"});
       });
    
    });
    

    The above solution is compiled from two different solutions commenced by @user113716 and @travis

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

Sidebar

Related Questions

I have a thread that downloads some images from internet using different proxies. Sometimes
I have an inner class that downloads some images from the server. The problem
guys, I have UITableView with some images, which are loading from internet. Images is
I have some images that need to change, based not only on hover, but
I have some static images in a folder on my IIS 6-based website that
I have some text/images that I only want to display in the normal state
I have some static resources (images and HTML files) that will be localized. One
i have an UITableView in my app and i have to load some images
I have a div with id=images. The div contains some images that are each
i have some images that get displayed on a page, some of them don't

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.