Why does the following statement throw an error?
Idea: To show an image from the normal URL. If it\'s not found (404), show a fallback image.
<
Try this:
if(typeof(src)==="undefined") { $("#imageID").attr("src","yourNewSource_goes_here"); }
If that doesn't work, you can try this:
if(document.getElementById("myImg").complete==false) { $("#myImg").attr("src","another_source_goes_here"); }