Quote:
Originally Posted by adios
This requires JS, but works in IE as well:
<img ..... onerror="this.src='src of default image'" />
The onerror handler runs when an image fails to load.
|
A small but important detail -
In a webpage with an HTML snippit such as the above, a stack overflow
error occurs if the image file does not exist:-
onerror = "this.src = 'some-other-non-existent-filename.jpg';">
So important to ensure that the default image exists in the correct directory.