Difference between revisions of "JQuery promise method"

From Wiki @ Karl Jones dot com
Jump to: navigation, search
(Created page with "In jQuery, the '''.promise() method''' returns a dynamically generated Promise that is resolved once all actions of a certain type bound to the collection, queued or not,...")
 
(See also)
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
In [[jQuery]], the '''.promise() method''' returns a dynamically generated Promise that is resolved once all actions of a certain type bound to the collection, queued or not, have ended.
+
{{lowercase}}In [[jQuery]], the '''.promise() method''' returns a dynamically generated Promise that is resolved once all actions of a certain type bound to the collection, queued or not, have ended.
  
 
== Description ==
 
== Description ==
Line 13: Line 13:
 
* [[Futures and promises]]
 
* [[Futures and promises]]
 
* [[jQuery Deferred object]]
 
* [[jQuery Deferred object]]
 +
* [[Promise object (JavaScript)]]
  
 
== External links ==
 
== External links ==
  
 
* [https://api.jquery.com/promise/ .promise()] @ api.jquery.com  
 
* [https://api.jquery.com/promise/ .promise()] @ api.jquery.com  
 +
* [https://api.jquery.com/deferred.promise/ deferred.promise()] @ api.jquery.com
 +
* [http://www.vasanthk.com/jquery-promises-and-deferred-objects/ What’s the deal with jQuery Deferred objects and Promises?]
 +
* [http://www.htmlgoodies.com/beyond/javascript/making-promises-with-jquery-deferred.html Making Promises With jQuery Deferred]
 +
* [https://code.tutsplus.com/tutorials/wrangle-async-tasks-with-jquery-promises--net-24135 Wrangle Async Tasks With JQuery Promises] by Trevor Burnham
 +
* [http://www.bitstorm.org/weblog/2012-1/Deferred_and_promise_in_jQuery.html Deferred and promise in jQuery]
 +
* [https://www.sitepoint.com/introduction-jquery-deferred-objects/ An Introduction to jQuery’s Deferred Objects] by Aurelio De Rosa
 +
* [http://robdodson.me/make-your-own-jquery-deferreds-and-promises/ Make Your Own jQuery Deferreds and Promises]
 +
* [http://blog.mediumequalsmessage.com/promise-deferred-objects-in-javascript-pt2-practical-use Promise & Deferred Objects in JavaScript Pt.2: in Practice]
 +
* [http://jqfundamentals.com/chapter/ajax-deferreds AJAX & Deferreds]
 +
* [https://www.quora.com/How-do-I-create-and-resolve-a-JavaScript-or-jQuery-promise How do I create and resolve a JavaScript or jQuery promise?]
 +
* [http://www.html5rocks.com/en/tutorials/async/deferred/ Asynch JS: The Power Of $.Deferred]
 +
* [https://abdulapopoola.com/2014/12/12/the-differences-between-jquery-deferreds-and-the-promisesa-spec/ Differences between jQuery Deferreds and the Promises/A+ spec]
 +
* [https://gist.github.com/domenic/3889970 You're Missing the Point of Promises]
 +
* [http://blog.monkey.codes/sequential-ajax-and-jquerys-promise/ Sequential AJAX and jQuery's Promises]
 +
* [https://blog.domenic.me/youre-missing-the-point-of-promises/ You're Missing the Point of Promises]
 +
* [http://blog.revathskumar.com/2016/06/why-i-prefer-ajax-promise.html JQuery : Why I prefer $.ajax promise]
 +
* [https://www.npmjs.com/package/jquery.promises jquery.promises] - Grouping related jQuery Deferreds, managing them collectively.
 +
* [https://makandracards.com/makandra/39543-jquery-promises-done-and-then-are-not-the-same jQuery promises: .done and .then are not the same]
 +
* [https://thewayofcode.wordpress.com/tag/jquery-deferred-broken/ Javascript Promises And Why Jquery Implementation Is Broken]
 +
* [https://davidwalsh.name/write-javascript-promises Write Better JavaScript with Promises]
 +
* [http://eng.wealthfront.com/2012/12/04/jquerydeferred-is-most-important-client/ jQuery.Deferred is the most important client-side tool you have]
 +
* [http://www.columbia.edu/~njn2118/journal/2015/9/11.html http://www.columbia.edu/~njn2118/journal/2015/9/11.html]
 +
* [http://www.learningjquery.com/wp-content/themes/ljq/docs-1.7.php?fn=promise promise]
 +
* [http://hermanradtke.com/2011/05/12/managing-multiple-jquery-promises.html Managing multiple jQuery promises] by Herman Radtke III
 +
* [http://phdesign.com.au/programming/mapping-errors-in-jquery-promises-deferred/ Mapping Errors In Jquery Promises / Deferred]
 +
* [http://valera-rozuvan.github.io/nintoku/jquery/promises/jquery-broken-promises-illustrated jQuery broken promises illustrated]
 +
* [http://www.i-programmer.info/programming/jquery/4788-jquery-promises-a-deferred.html?start=1 jQuery, Promises & Deferred] @ I Programmer
 +
* [https://coderwall.com/p/kl7ahq/manage-async-events-with-jquery-promise Manage async events with Jquery promise]
 +
* [http://collaboradev.com/2014/01/27/understanding-javascript-promises-in-jquery/ Understanding JavaScript Promises In jQuery]
 +
* [http://www.solid.ws/blog/promise-chains Promise Chains]
 +
* [http://www.danieldemmel.me/jquery-deferred-intro/jquery-deferred-intro/slides.html Deferred / Promise pattern using jQuery] by Daniel Demmel
 +
* [http://www.unknownerror.org/opensource/jasmine/jasmine/q/stackoverflow/13148356/how-to-properly-unit-test-jquery39s-ajax-promises-using-jasmine-and-or-sinon How to properly unit test jQuery's .ajax() promises using Jasmine and/or Sinon?]
 +
* [https://blog.kevinchisholm.com/javascript/jquery/using-the-jquery-promise-interface-to-avoid-the-ajax-pyramid-of-doom/ Using the jQuery Promise Interface to Avoid the AJAX Pyramid of Doom]
 +
* [https://lostechies.com/derickbailey/2012/03/27/providing-synchronous-asynchronous-flexibility-with-jquery-when/ Providing Synchronous / Asynchronous Flexibility With jQuery.when] by Derick Bailey
 +
* [http://www.ryanmwright.com/2011/09/06/always-keep-your-jquery-promises/ Always keep your (jQuery) Promises] by Ryan
 +
* [http://www.maori.geek.nz/i_promise_this_will_be_short/ JQuery Promises and Deferreds]
 +
* [https://msdn.microsoft.com/en-us/magazine/gg723713.aspx Creating Responsive Applications Using jQuery Deferred and Promises] by Julian Aubourg and Addy Osmani
 +
* [http://cargocollective.com/jackm/Recursive-Promises-Example Recursive Promises Example] by Jack Montgomery
 +
* [http://www.tutorialsavvy.com/2013/11/jquery-promise-object-for-asynchronous-method-handling.html/ Jquery Promise Object For Asynchronous Method Handling] by Sandeep
 +
* [https://www.mobomo.com/2011/02/fun-with-jquery-deferred/ Fun With jQuery Deferred] by Michael Bleigh 
 +
* [https://www.roelvanlisdonk.nl/2014/07/13/how-to-pass-extra-additional-parameters-to-the-deferred-thenfunction-in-jquery-q-angularjs-or-q/ How to pass extra / additional parameters to the deferred.then()function in jQuery, $q (AngularJS) or Q] by Roel van Lisdonk
 +
* [http://www.lampdev.org/programming/jquery/jquery-deferred-chained-ajax-calls.html JQuery promise and deferred chained calls]
 +
* [http://www.mattlunn.me.uk/blog/2014/01/tracking-joining-parallel-ajax-requests-with-jquery/ Tracking/ joining parallel AJAX requests with jQuery] by Matt Lunn
 +
 +
 +
  
  
Line 22: Line 69:
 
[[Category:Computer science]]
 
[[Category:Computer science]]
 
[[Category:Computing]]
 
[[Category:Computing]]
 +
[[Category: JavaScript promises]]
 
[[Category:jQuery]]
 
[[Category:jQuery]]

Latest revision as of 06:28, 25 September 2016

In jQuery, the .promise() method returns a dynamically generated Promise that is resolved once all actions of a certain type bound to the collection, queued or not, have ended.

Description

By default, type is "fx", which means the returned Promise is resolved when all animations of the selected elements have completed.

Resolve context and sole argument is the collection onto which .promise() has been called.

If target is provided, .promise() will attach the methods onto it and then return this object rather than create a new one. This can be useful to attach the Promise behavior to an object that already exists.

See also

External links