img.onload = function () { if (this.complete==false) { alert("image is not loaded..."); }else{ alert("loaded..."); } }