That just to see if the browser supports document.images, and in that
case, carry out the script.
I haven't looked at the script carefully, but it seemed to be the
correct way to preload images...
/Robert
-----Ursprungligt meddelande-----
Fr=E5n: SEAK, Teng-Fong [mailto:tfseak@f...]
Skickat: den 11 november 2002 17:21
Till: javascript
=C4mne: [javascript] RE: SV: RE: Image rollover
There's one thing I don't understand in his code, what's the use
of "if (document.images)" ? As a first glance, I thought it was like
checking if the "images" object property exists, but his code seemed to
mean otherwise. It seemed to mean that if the images array is not
empty, then the if-clause, otherwise else-clause. Didn't I make it
wrong and my first thought was correct?
Anyway, why is it necessary to test document.images??? I
usually just do things like: var img1 =3D new Image() img1.src =3D
some_pic.jpg
> -----Message d'origine-----
> De : Robert Nyman [mailto:robert.nyman@c...]
> Envoy=E9 : lundi 11 novembre 2002 16:39
> =C0 : javascript
> Objet : [javascript] SV: RE: Image rollover
>
>
> Just to (hopefully) end this thread:
>
> Yes, you can place the code in the HEAD section. Please read these
> articles:
> http://www.faqts.com/knowledge_base/view.phtml/aid/1358/fid/122
>
> "Place the script itself in the HEAD of your document, and then place
> the mouseover code where you want it to appear in the BODY of
> your document"
> http://www.webdeveloper.com/javascript/javascript_preload_roll.html
>
>
> /Robert
>