jQuery deferred.done() Method Last Updated : 26 Jul, 2024 Suggest changes Share Like Article Like Report This deferred.done() method in jQuery is used to add handlers which are to be called when the deferred object is resolved.Syntax: deferred.done(Callbacks [, Callbacks])Parameters:Callbacks: This parameter specifies a function, or array of functions, which are called when the Deferred is resolved.Callbacks: This parameter specifies an optional additional functions, or arrays of functions, which are called when the Deferred is resolved. Return Value: This method returns the deferred object.Example 1: html <!DOCTYPE HTML> <html> <head> <script src="https://code.jquery.com/jquery-3.5.0.js"> </script> </head> <body style="text-align:center;"> <h1 style="color:green;"> GeeksForGeeks </h1> <p> JQuery | deferred.done() method </p> <button onclick="Geeks();"> click here </button> <script> function Geeks() { $.get("testingGFG.php").done(function () { alert("$.get successfully completed!"); }); } </script> </body> </html> Output: Example 2: html <!DOCTYPE HTML> <html> <head> <script src= "https://code.jquery.com/jquery-3.5.0.js"> </script> </head> <body style="text-align:center;"> <h1 style="color:green;"> GeeksForGeeks </h1> <p> JQuery | deferred.done() method </p> <button onclick="Geeks();"> click here </button> <p id="GFG_DOWN"></p> <script> var el_down = document .getElementById("GFG_DOWN"); function Geeks() { $.get("testingGFG.php") .done(function () { el_down.innerHTML = "$.get successfully completed"; }); } </script> </body> </html> Output: P PranchalKatiyar Follow Article Tags : JQuery jQuery-Methods Explore jQuery Tutorial 8 min read Getting Started with jQuery 4 min read jQuery Introduction 7 min read jQuery Syntax 2 min read jQuery CDN 4 min read jQuery SelectorsJQuery Selectors 5 min read jQuery * Selector 1 min read jQuery #id Selector 1 min read jQuery .class Selector 1 min read jQuery EventsjQuery Events 4 min read jQuery bind() Method 2 min read jQuery blur() Method 1 min read jQuery change() Method 2 min read jQuery EffectsjQuery animate() Method 2 min read jQuery clearQueue() Method 2 min read jQuery delay() Method 2 min read jQuery HTML/CSSjQuery addClass() Method 2 min read jQuery after() Method 1 min read jQuery append() Method 2 min read jQuery TraversingjQuery | Traversing 4 min read jQuery add() method 1 min read jQuery addBack() Method 2 min read My Profile ${profileImgHtml} My Profile Edit Profile My Courses Join Community Transactions Logout Like