Why won't Internet Explorer (or Chrome) display my 'Loading...' gif but Firefox will?

Posted by codeLes on Stack Overflow See other posts from Stack Overflow or by codeLes
Published on 2010-05-06T19:05:37Z Indexed on 2010/05/06 19:08 UTC
Read the original article Hit count: 191

Filed under:
|

I have a page that fires several xmlHttp requests (synchronous, plain-vanilla javascript, I'd love to be using jquery thanks for mentioning that).

I'm hiding/showing a div with a loading image based on starting/stopping the related javascript functions (at times I have a series of 3 xmlhttp request spawning functions nested).

div = document.getElementById("loadingdiv");
if(div) {
    if(stillLoading) {
        div.style.visibility='visible';
        div.style.display='';

    } else {
        div.style.visibility='hidden';
        div.style.display='none';
    }
}

In Firefox this seems to work fine. The div displays and shows the gif for the required processing. In IE/Chrome however I get no such feedback. I am only able to prove that the div/image will even display by putting alert() methods in place with I call the above code, this stops the process and seems to give the browsers in question the window they need to render the dom change.

I want IE/Chrome to work like it works in Firefox. What gives?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about xmlhttp