Forum Moderators: open

Message Too Old, No Replies

Smelling out a bad image

and replacing it on the client.

         

joshie76

3:02 pm on Sep 26, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In a 3 tier app where users can create their own entities I want to use icons for various types of records. However, if someone creates a new entity then (obviously) no image will exist for it and a X image will show, yuk.

Is there a way to look at an image on the client and tell if it is a bad one? It needs only work in IE, this check would be done to replace the bad image with a standard one.

Unfortunately because this is all handled by XSL parsing XML it HAS to be done on the client to avoid significant movement of the system architecture - which won't happen for a few icons!

Any ideas?

roded

9:59 pm on Sep 26, 2001 (gmt 0)



<img onerror="alert('bad image');">

Hope that helps.

joshie76

8:15 am on Sep 27, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks roded works a treat!

J