Skip to content

Commit 7f12994

Browse files
Krinklemgol
authored andcommitted
jQuery.ready: create page
Also categorise jQuery.holdReady in events/document-loading and properties/global-jquery-object-properties, to match jQuery.ready. Fixes jquery#205 Closes jquery#983
1 parent 65f99f9 commit 7f12994

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

entries/jQuery.holdReady.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,7 @@ $.getScript( "myplugin.js", function() {
2222
]]></code>
2323
</example>
2424
<category slug="core"/>
25+
<category slug="properties/global-jquery-object-properties"/>
26+
<category slug="events/document-loading"/>
2527
<category slug="version/1.6"/>
2628
</entry>

entries/jQuery.ready.xml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?xml version="1.0"?>
2+
<entry type="property" name="jQuery.ready" return="Thenable">
3+
<title>jQuery.ready</title>
4+
<desc>A Promise-like object (or "thenable") that resolves when the document is ready.</desc>
5+
<signature>
6+
<added>1.8</added>
7+
</signature>
8+
<longdesc>
9+
<p>As of jQuery 3.0, use of this object is supported via <code><a href="/jQuery.when/">jQuery.when</a></code> or the native <code>Promise.resolve()</code>. Code should not make assumptions about whether this object is a <code>jQuery.Deferred</code>, native Promise, or some other type of promise object.</p>
10+
<p>See also <code><a href="/ready/">ready()</a></code>, which makes use of this.</p>
11+
</longdesc>
12+
<example>
13+
<desc>Listen for document ready using <code><a href="/jQuery.when/">jQuery.when</a></code>.</desc>
14+
<code><![CDATA[
15+
$.when( $.ready ).then(function() {
16+
// Document is ready.
17+
});
18+
]]></code>
19+
</example>
20+
<example>
21+
<desc>Typical usage involving another promise, using <code><a href="/jQuery.when/">jQuery.when</a></code>.</desc>
22+
<code><![CDATA[
23+
$.when(
24+
$.getJSON( "ajax/test.json" ),
25+
$.ready
26+
).done(function( data ) {
27+
// Document is ready.
28+
// Value of test.json is passed as `data`.
29+
});
30+
]]></code>
31+
</example>
32+
<category slug="core"/>
33+
<category slug="properties/global-jquery-object-properties"/>
34+
<category slug="events/document-loading"/>
35+
<category slug="version/1.8"/>
36+
</entry>

0 commit comments

Comments
 (0)