I have managed to solve this in the following way:
A simple script
$(document).ready(function(){
/**
* Determinar si una imagen existe por la propiedad naturalHeight
* la cual sera diferente de 0 si esta existe
**/
$('img').each(function(){
if($(this)[0].naturalHeight == 0){
$(this).attr('src','images/image_not_found.jpg');
}
});
});
I managed to find this solution through the property naturalHeight
which must be different from 0 if the image exists, no matter how small the image must have a height.
Maybe it's not the best way but if you have a "big" project many times javascript
is a solution.