Re: Preloading graphics

by Brian <brianj(at)ais.ais-gwd.com>

 Date:  Fri, 03 Apr 1998 15:33:58 -0500
 To:  hwg-graphics(at)hwg.org
 References:  edu
  todo: View Thread, Original
Noone Special wrote:

>> Agreed, but it is still better to put the loading script into the BODY - it
>> eliminates potential problems with NN4.  This was discussed recently on
>> hwg-languages, here's the reference if anyone is interested:
>>
http://sunsite.unc.edu/hwg-bin/msgid?3501A917.2F5ACEB0(at)best.com&browsing=AAt
>
>Of course, if you have made your page correctly, using WIDTH and HEIGHT
>attributes on your images, the LAYOUT should be already visible before the
-------

Ok. One more time.
As long as you test for (document.images) nothing will go screwy.
The problem arises when you don't test for (document.images)

i.e. 

<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">

frame1 = new Image();
frame1.src = "http://www.blah.blah/frame1.gif";
frame2 = new Image();


.....However, if you use:

<html><head>
<Script Language="JavaScript" Type="text/JavaScript">
<!-- 
if(document.images) {

     frame1 = new Image();
     frame1.src = "http://www.blah.blah/frame1.gif";
}
-->
</Script>
</head></html>


..nothing will go wrong. Works every time (unless you use MSIE 2 or 3).
If you can prove to me that by using:

<html><head>
<Script Language="JavaScript" Type="text/JavaScript">
<!-- 
if(document.images) {

     frame1 = new Image();
     frame1.src = "http://www.blah.blah/frame1.gif";
}
-->
</Script>
</head></html>

that you get an error in NN4, or any other browser, I will sell my home and
move to
the Andies with a goat named Bob.

b.


"Experience is a hard teacher
because she gives the test first, 
the lesson afterward."

HWG: hwg-graphics mailing list archives, maintained by Webmasters @ IWA