может как-то так var img = new Image(); img.onload = function() { // the image is ready }; img.onerror = function() { // the image has failed }; img.src = "path/to/image.jpg";
может как-то так var img = new Image(); img.onload = function() { // the image is ready }; img.onerror = function() { // the image has failed }; img.src = "path/to/image.jpg";