Incorrect "true" for Image.complete...

Discussion in 'HTML Development' started by pbink, Jul 2, 2008.

  1. pbink New Member

    IE has no problems with...

    <script type="text/javascript">
    <!--
    function checkit(){
    for( var x=0; x<document.images.length; ++x ){
    alert( document.images[x].complete )
    }
    }
    //-->
    </script>

    ...however, Mozilla returns "true" for every image, even if the path is bad.

    Any Help?
  2. BurningSnowman Moderator

    I've not encountered this, but just googling, this page proposes a workaround of testing image width.
  3. pbink New Member

    This is the workaround...

    using if(!myImg.width) you can test to see whether an image has loaded or not. Seems to be just as good as myImg.complete so far...

Share This Page