We have no way to know if an image is broken or not especially if we are just hot linking it from some other site. Javascript’s onerror function just does that. To add a no-image-file as replacement instead of the broken image icon (which would make your site look unprofessional), use this function below.

and call it using this <img src="test.gif" onerror="onImgError(this)"/>

tip from: http://www.tech-evangelist.com/2007/09/15/missing-image-fix/

Related Posts Plugin for WordPress, Blogger...