Read more

Javascript: Wait until an image has finished loading

Henning Koch
June 13, 2016Software engineer at makandra GmbH

The attached ImageLoader helper will start fetching an image and return an image that is resolved once the image is loaded:

ImageLoader.load('/my/image.png').then(function(image) {
  ...
});
Illustration online protection

Rails Long Term Support

Rails LTS provides security patches for old versions of Ruby on Rails (2.3, 3.2, 4.2 and 5.2)

  • Prevents you from data breaches and liability risks
  • Upgrade at your own pace
  • Works with modern Rubies
Read more Show archive.org snapshot

The image argument that is yielded to the promise callback is an HTMLImageElement Show archive.org snapshot . This is the kind of object you get when you call new Image().

Posted by Henning Koch to makandra dev (2016-06-13 15:48)