Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

70% Asynchronicity

Or synchronicity, depending on the situation

This is "mad skills" β€” making asynchronous JavaScript work the way we want it to.

jQuery has several tools that will help us master this skill:

$.Deferred()

the Deferred object gives us the ability to register multiple callback functions and control their execution

$.when()

the when() method allows executing callback functions based on asynchronous Deferred objects

$.Callbacks()

the Callbacks object lets us manage a list of callback functions: add, disable, remove, and fire them

Since jQuery version 3.x, the Deferred object became compatible with ES-2015 (a.k.a. ES6) Promise, so practically everything related to Promise is also true for Deferred.

Let's take a closer look at each one.

Last updated