I want to preload an image with javascript, the method below seems simple enough but how can I check if the image has preloaded? Thanks
Preloading images with jQuery
I want to preload an image with javascript, the method below seems simple enough
Share
I would suggest modifying the code to add on ‘onerror’ event handler to the img tags you are generating. and then handle any failures.
http://www.w3schools.com/jsref/event_onerror.asp