...

View Full Version : Image preloading



Algorithm
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.

beetle
01-15-2003, 05:27 PM
ya...

imgRef.onerror = fp;

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

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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum