I\'m using JavaScript with the jQuery library to manipulate image thumbnails contained in a unordered list. When the image is loaded it does one thing, when an error occurs
var isImgLoaded = function(imgSelector){ return $(imgSelector).prop("complete") && $(imgSelector).prop("naturalWidth") !== 0; }
// Or As a Plugin
$.fn.extend({ isLoaded: function(){ return this.prop("complete") && this.prop("naturalWidth") !== 0; } }) // $(".myImage").isLoaded()