Showing a default image if one doesn’t exist in jQuery
Posted on June 27, 2012
Turns out you can attach an error handler to a jQuery element. This allows you to do something (i.e. set the src attribute to the default image) if the loading on the image fails. It’s pretty sweet.