Phone no: +234 705 673 3798 or email us: info@kdesglobal.com
The Deferred object, introduced in jQuery 1.5, is a chainable utility object created by calling the jQuery.Deferred()
method. It can register multiple callbacks into callback queues, invoke callback queues, and relay the success or failure state of any synchronous or asynchronous function.
The Deferred object is chainable, similar to the way a jQuery object is chainable, but it has its own methods. After creating a Deferred object, you can use any of the methods below by either chaining directly from the object creation or saving the object in a variable and invoking one or more methods on that variable.
$.get( "www.yoursite.com/api" ).always(function() { console.log('this will run whether the $.get fails or succeeds'); });
$.get( "www.yoursite.com/api" ).done(function() { console.log('this will run only when the $.get succeeds'); });
$.get( "www.yoursite.com/api" ).fail(function() { console.log('this will run if the $.get fails'); });
$.get( "www.yoursite.com/api" ).then( function() { console.log('this run if the $.get succeeds'); }, function() { console.log('this run if the $.get fails'); }, function() { console.log('this run if the deferred generates a progress update'); } );
Read Now Top 15 Reasosns why you need a website for your BusinessYou don’t need to do all of these alone, We got you covered!! Contact us now your satisfaction is always our priority. price definitely won't be a problem.
« Previous What is Flash Storage | Different Between Flash Storage and Hard Disk Storage |
Next » The Importance of Emotional Intelligence in Fostering Connection and Belonging in Remote-First Companies |
Written by: Idika Destiny
Reading time:
Published 17 hours Ago On Wednesday, August 9, 2023
444 Views