Pro jQuery by Adam Freeman

Safari, the world’s most comprehensive technology and business learning platform.

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required

O'Reilly logo

C H A P T E R  35

Using Deferred Objects

Throughout this book, you have seen examples that relied on callbacks. You provide a function that is executed when something occurs. A good example is the way you have been handling events, where you call a method such as click, passing in a function as an argument. The code statements in the function are not performed until the user triggers the event. Until that point, your function is dormant.

Deferred objects is the jQuery term for a set of enhancements to the way you use callbacks. When using deferred objects, you can use callbacks in any situation and not just for events. You also gain a lot of options and control over when and how your callback functions are executed. Deferred objects are most ...

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required