[Javascript] image preloader doubts

Steve Clay sclay at ufl.edu
Thu Jul 20 09:59:22 CDT 2006


Thursday, July 20, 2006, 10:36:17 AM, Steve Clay wrote:
> function loadingImage(src) {
>   var img = new Image;
>   img.src = src;
>   return img;
> }

> // just load an image
> loadingImage('http://example.com/jane.png');

Oops, if not stored in a var will the new Image object exist long enough to
finish loading the image?

-- 
Steve
http://mrclay.org/




More information about the Javascript mailing list