Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use JQuery.ready

Shulou Source: shulou.com Published: 2022-06-01 07:35:01 09月30日 Update

This article mainly introduces how to use JQuery.ready related knowledge, content detailed and easy to understand, simple and fast operation, has a certain reference value, I believe everyone will read this article JQuery.ready how to use the article will have some gains, let's take a look at it.

JQuery.ready

Description: A promise-like object (or "Thable") that is parsed when the document is ready.

Added version: 1.8JQuery.ready

Starting with jQuery 3.0, either jQuery.when or native Promise.resolve(). The code should not assume that this object is jQuery.Deferred, a local commitment, or another type of commitment object.

See also ready() to use this.

Examples:

Listen for documents ready to use jQuery.when.

$.when( $.ready ).then(function() {

// Document is ready.

});

Another typical usage involving commitments is jQuery.when.

$.when(

$.getJSON( "ajax/test.json" ),

$.ready

).done(function( data ) {

// Document is ready.

// Value of test.json is passed as `data`.

});

About "JQuery.ready how to use" The content of this article is introduced here, thank you for reading! I believe everyone has a certain understanding of "JQuery.ready how to use" knowledge. If you still want to learn more knowledge, please pay attention to the industry information channel.

Tags: Objects knowledge content documents articles preparation code value examples typical easy to operate articles easy to understand more locals versions see types industries information Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno Xiaomi Linux vpn Shulou Tech Info