yet another preload question

Hi folks, I have read thru and tried some of the various answers for prelaoding images in a page and am missing something, and probably something simple at that.  Nothing complicated here, a sample of the code is:
<html>
<head>
<title>Untitled</title>
<script language="JavaScript1.2">
preLoad1 = new Image();
preLoad1.src = "logo.gif";
</script>
</head>
<body bgcolor="black" onLoad="pageloaded=true;">

  <table width=1000 border=0 cellpadding=0 cellspacing=0>
  <td width=180 align=left valign=top>
    <img src="preLoad.src">
  </td>
  <td valign=middle align=right>

</body>
</html>


I can't figure out the correct reference in the IMG SRC code, basic stuff but my brain is starting to hurt and I have points to give to someone that can show me the errors of my ways.

Thanks,
Bill
GossettBGAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

GossettBGAuthor Commented:
Edited text of question.
0
mgfranzCommented:
Use this;

<SCRIPT LANGUAGE="JavaScript">

<!--
ccImageSrc = new Array (
"image1.jpg", "image2.jpg", "image3.gif", "image4.gif"

)
ccImageList = new Array ();

for (counter in ccImageSrc) {
ccImageList[counter] = new Image();
ccImageList[counter].src =
ccImageSrc[counter];
}
// -->
</SCRIPT>

Insert it in your <head></head> section, change the name of the images to reflect the images you want to pre-load, and your off!

Mark
0
GossettBGAuthor Commented:

What would the reference code for the <IMG SRC=""> look like?  Still can't figure that part out.  Here's the code I'm working with:

<body bgcolor="black" onLoad="pageloaded=true;">

<table width=1000 border=0 cellpadding=0 cellspacing=0>
<td width=180 align=left valign=top>
<img src="preLoad.src">
</td>

</body>
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

mgfranzCommented:
No, no, no... you don't need to use <img src=preload.src>.  When the page loads, the function is ran automatically.  you simply call the image as any normal img call;

<table width=1000 border=0 cellpadding=0 cellspacing=0>
<td width=180 align=left valign=top>
<img src=image3.gif>
</td>

</body>

Since the image is already loaded into cache it will open almost instantaniously.
0
GossettBGAuthor Commented:
OK, now I see that I was making this more complicated than needed. Mark - your answer is fine, if you re-post it I'll get you the points.  Thanks for the help and explaination.

Bill
0
mgfranzCommented:
Remember, just about every page, image, .class file or script is loaded into your cache directory.  Read up on setting <meta> tags for no-cache if you want to not allow files to load into cache.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
HTML

From novice to tech pro — start learning today.