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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:52:32+00:00 2026-05-27T10:52:32+00:00

I’m having some odd and intermittent errors, which I assume are related to my

  • 0

I’m having some odd and intermittent errors, which I assume are related to my jQuery. I made a simple content preloader that renders all the images for an application and then displays the content once it is completed. Below is the script:

<?php

$i=0;

$handle=opendir('images');

while(false!==($file=readdir($handle)))
{
  if($file!="." && $file!=".." && $file!=basename(__FILE__))
  { ?>
    <img class="image_preload hidden" src="<?php echo $app_info['image_url'].$file; ?>"></img> <?php 

    $i++;
  }
} ?>

<script>
  max_loaded=<?php echo $i; ?>;
  $('.image_preload').bind({'load':function(){preloadCounter();},'error':function(){preloadCounter();}});
</script>


  function preloadCounter()
  {
    total_loaded++;

    $('#loading_percentage').text(Math.floor((total_loaded/max_loaded)*100));
    $('#loading_bar').css('width',Math.floor((total_loaded/max_loaded)*100)+'%');

    if(total_loaded==max_loaded && max_loaded>0)
    {
      $('#load_display').hide();
      $('#app_display').show();

      setCanvasSize();
      runOnStart();
    }
  }

The PHP code runs first, of course. The script searches through the images directory and renders all the images and hides them. $i is incremented when an image put into the page.

When this is done, it is supposed to set off the event listener (tied for both ‘load’ and ‘error’) at the bottom of the page. It first sets the max_loaded var to the amount of images put into the page and then the listener should trigger.

The jQuery then modifies a loading bar according to how far along a JS var is incremented. When it the page is done loading or is through with errors, it should display my application’s content.

This works on occasion, with most errors coming from IE. I have had reports from several users that it fails across all latest browsers. Strangely enough, it works fine for others in the latest browsers.

Is there something I’m missing here? I do get the error on occasion in IE, but there are never any errors displayed in Dev Mode. I’m at a loss.

The problem is that it will load some content, but not all. The loading bar ends up stalling at any percentage. Sometimes it’ll go through, sometimes it won’t.

  • 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-27T10:52:33+00:00Added an answer on May 27, 2026 at 10:52 am

    Issue was with browser caching. Using a jQuery plugin called ImageMonitor fixed the problem.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function

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.