[Javascript] Alternative Image

Innerlab innerlab at hotmail.com
Tue May 17 13:36:00 CDT 2005


----- Original Message ----- 
From: "Cutter (JS)" <java.script at seacrets.com>

> Generally JS is a client side language, whereas you would want a
> server side language for directory access...

The original images displayed are dynamic (with ASP). But If I rely on SQL
queries to a database, or some file system commands to check my website
folders to see if such image is there, the whole things takes too many
resources (plus the time of typing the images' names into a DB). So I hoped
the client could do that with javascript.

I found the following solution, but it may not work with all browsers:

<img src="Orig_Img.jpg" onerror="this.src='Alt_Img.jpg';" />



More information about the Javascript mailing list