[Javascript] An image loader nearly working except for IE

J. Lester Novros II lester at denhaag.org
Mon Jul 18 15:12:36 CDT 2005


Lau wrote:
> The only suggestion I'd make is to pass the image url and insertion point ID
> as parameters so that you can put the script in an include file and then
> call it from the body onload tag with the parameters.

The original author had put an XHTML strict DTD at the top of his file so I 
tried to concoct something that would validate as such; if I am not mistaken, 
inline event handlers do not.

Also, recent approaches to web design tend to separate structure, style and 
script as much as possible which is another reason not to use inline handlers.

OTOH, one could always assign the name of the image to a variable at the top of 
the script to prevent others from having to dig deeply into its bowels to point 
to a different image. And in the case of more than 1 image, I would put names 
and dimensions in an array in a separate included file and access its values 
from the script.

l8R lES
-- 
"Anti-virus products for Unix servers occupy a useful niche in the market, not
because there are many viruses that infect Unix platforms but because they help
prevent these servers from hosting Windows malware."  John Leyden - the Register
                                                           http://www.denhaag.org



More information about the Javascript mailing list