[Javascript] image preloading problems

Peter Brunone peter at brunone.com
Fri Aug 10 12:39:11 CDT 2001


Jon,

    Just an unrelated observation (I apologize if this has been brought up
already), but it's generally better coding practice to use the HREF property
of a link with the javascript: pseudoprotocol rather than its onClick event
handler, e.g.

<A HREF="javascript:doThisFunction(withThisParameter)">

My $0.02...

Peter

----- Original Message -----
From: "Jon Drukman" <jsd at cluttered.com>
To: <javascript at LaTech.edu>
Sent: Friday, August 10, 2001 12:26 PM
Subject: Re: [Javascript] image preloading problems


| At 01:16 PM 8/10/2001 -0400, Cutter Bl wrote:
| >Why preload in this instance?
|
| ideally because i'd like to open the new window to the exact size of the
| image file.  the images are all of varying sizes and i don't know them
| ahead of time.  although i suppose i could just measure them and build a
| database and do it that way.  seems like a drag.
|
| the frustrating thing is that when it works it works really well and looks
| very nice.  i'm loathe to give it up.
|
| ><a href="javascript:void(0)"
|
>onClick="window.open('itempic.html','1205','toolbar=no,location=no,scrollba
rs=no,statusbar=no')"><img
| >border="1" src="images/1205.sm.jpg" align="left" hspace="5"
| >class="clsItemPic" id="1205" alt="Fishing Knife" width="173"
height="130"></a>
|
| yeah i'll probably end up doing this.
|
| -jsd-




More information about the Javascript mailing list