JavaScript - Display image if given image not availble?

MistarItalian

Pain In The Ass5
Veteran X
I have a database setup with teachers (Im doing a website for a school) and I put the location of the pictures, but I don't have the pictures to put up there yet. Is it possible to display something like "noimage.gif" if the picture it's attempting to go to doesn't exist on the server?
 
MistarItalian said:
I have a database setup with teachers (Im doing a website for a school) and I put the location of the pictures, but I don't have the pictures to put up there yet. Is it possible to display something like "noimage.gif" if the picture it's attempting to go to doesn't exist on the server?
There are many ways to do it, but why don't you google and spare us the effort?
 
I had been looking all over google, then finally typed in the right words, and got it. It's something extremely simple.
 
In IE, you can use the onerror="something();" approach.

That's about the only thing I know.
 
Back
Top