views:

26

answers:

1

Hi,

I am developing a firefox extension and need to know that all images are loaded without attaching onload event handler to those images. Is this possible?

I tried document.images[0].complete attribute but it always returns true.

A: 
function allImagesLoaded() {
    for(var i = document.images.length - 1; i>= 0; --i) if(!document.images[i].complete) return false;
    return true;
}
Avindra Goolcharan
In firefox, complete always returns true
matte