I ran into the same problem with ie, and installing img src alone allowed enough time to catch the image error
$(document).ready(function() { $("#mainImage").error(function () { $(this).attr("src", "generic.jpg"); }) .each(function() { $(this).attr("src",$(this).attr("src")); }); });
source share