Javascript examples for jQuery Method and Property:done
Return value from inside a function with done()
<html> <head> <script src="https://code.jquery.com/jquery-2.1.1.min.js"></script> </head> <body> <script> var d = $.Deferred();//w ww. j av a 2 s . c om var myResult=null; d.done(function (a){ myResult=a; }) .done(function (){ console.log(window["myResult"]) }); d.resolve(1); </script> </body> </html>