In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail about jQuery.when what is used, Xiaobian thinks it is quite practical, so share it for everyone to make a reference, I hope you can gain something after reading this article.
jQuery.when( deferreds )
Description: Provides a method to execute callback functions for one or more objects, Deferred objects typically representing asynchronous events.
Version added: 1.5jQuery.when(deferees)
deferreds
Type: Deferred
One or more deferred objects, or plain JavaScript objects.
If you pass a deferred object to jQuery.when, its Promise object (a subset of deferred methods) is returned. You can continue to bind other methods of the Promise object, for example, defaulted.then. When a deferred object has been resolved or rejected (usually executed by the original code that created the deferred object), the appropriate callback function is invoked. For example, the jqXHR object returned by jQuery.ajax is a deferred object and can be used as follows:
$.when( $.ajax("test.aspx") ).then(function(data, textStatus, jqXHR){
alert( jqXHR.status ); // alerts 200
});
If a parameter is passed to jQuery.when, it is treated as a resolved deferred object, and any doneCallbacks added to it are executed immediately. What is passed into doneCallbacks is the original argument. In this case, any failbacks set will never be executed because deferred objects will never be rejected. For example:
$.when( { testing: 123 } ).done(
function(x) { alert(x.testing); } /* alerts "123" */
);
About "jQuery.when what is used" this article is shared here, I hope the above content can be of some help to everyone, so that you can learn more knowledge, if you think the article is good, please share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.