View Full Version : Image preloading

01-15-2003, 10:32 AM
I'm in the process of developing an image preloading script that relies on the .complete property of its Image objects to tell it when to stop running. However, I've found that if bogus filenames are entered, the .complete flag never seems to be set to true. Is there any reliable way (apart from window.onload) to tell when the browser has stopped attempting to load broken images?

Thanks in advance.

01-15-2003, 05:27 PM

imgRef.onerror = fp;

Note: fp means 'function pointer', in case you didn't know.

01-15-2003, 07:05 PM
...where fp is a function that you previously defined ;)