Is it possible to detect when an image doesn't load with JavaScript? I plan on using base64 for images, but browsers such as IE 6 and 7 doesn't support it. So instead of displaying a red x, I'd like to detect such an error, then display a non base64 image. Below is an example of my intentions:
PHP
$base64Img = base64 String;
print("<img src=\"data:image/jpeg; base64, ".$base64Img."\" />");
JavaScript IE 6
catch img load error{
errorImg.src = "ieSafeImg.jpg";
}