Last Updated: May 31, 2021
·
2.578K
· afgomez

Simple image preloading with jQuery and promises

I made a simple image jQuery image preloader that uses the jQuery.Deferred object to attach callbacks.

$.preload(url, url, ...).done(function(img, img ,...) {
  // do magic stuff
});

Have a fresh tip? Share with Coderwall community!

Post
Post a tip
Did you know?

JavaScript on a page runs with the privileges of that origin. One altered library, tag manager, or snippet can read inputs, change what people see, and call your APIs as the user.

Security insights from Cside