var image = new Image(); image.onload = function() { alert(true) }; image.onerror = function() { alert(false) }; image.src = mySrc;