"Jake G" <jg******@dps.state.oh.uswrote in message
news:11*********************@p77g2000hsh.googlegro ups.com...
>I was wondering if anyone could help me with this?
I am dynamically loading an image after a user selects an item in a
list box. If the image is not available I would like to load a nice
error image, rather than the ugly red x that comes up. Any
suggestions? I was hoping to do it with out another function.
I am not entirely sure widely implemented it is, but I have seen a consistent use of
onload and onerror with the IMG tag.
For example:
<img src="http://www.google.com/intl/en_ALL/images/logo.gifx" alt="" width="" height=""
onload="alert('loaded');" onerror="this.src =
'http://www.google.com/images/nav_logo.png';" />
If you load that in Internet Explorer, it will not show the images with empty width and
height attributes.
-Lost