Skip to content

Commit

Permalink
jQuery.ready: create page
Browse files Browse the repository at this point in the history
Also categorise jQuery.holdReady in events/document-loading and
properties/global-jquery-object-properties, to match jQuery.ready.

Fixes #205
Closes #983
  • Loading branch information
Krinkle authored and mgol committed Mar 22, 2017
1 parent 65f99f9 commit 7f12994
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
2 changes: 2 additions & 0 deletions entries/jQuery.holdReady.xml
Expand Up @@ -22,5 +22,7 @@ $.getScript( "myplugin.js", function() {
]]></code>
</example>
<category slug="core"/>
<category slug="properties/global-jquery-object-properties"/>
<category slug="events/document-loading"/>
<category slug="version/1.6"/>
</entry>
36 changes: 36 additions & 0 deletions entries/jQuery.ready.xml
@@ -0,0 +1,36 @@
<?xml version="1.0"?>
<entry type="property" name="jQuery.ready" return="Thenable">
<title>jQuery.ready</title>
<desc>A Promise-like object (or "thenable") that resolves when the document is ready.</desc>
<signature>
<added>1.8</added>
</signature>
<longdesc>
<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>
<p>See also <code><a href="/ready/">ready()</a></code>, which makes use of this.</p>
</longdesc>
<example>
<desc>Listen for document ready using <code><a href="/jQuery.when/">jQuery.when</a></code>.</desc>
<code><![CDATA[
$.when( $.ready ).then(function() {
// Document is ready.
});
]]></code>
</example>
<example>
<desc>Typical usage involving another promise, using <code><a href="/jQuery.when/">jQuery.when</a></code>.</desc>
<code><![CDATA[
$.when(
$.getJSON( "ajax/test.json" ),
$.ready
).done(function( data ) {
// Document is ready.
// Value of test.json is passed as `data`.
});
]]></code>
</example>
<category slug="core"/>
<category slug="properties/global-jquery-object-properties"/>
<category slug="events/document-loading"/>
<category slug="version/1.8"/>
</entry>

0 comments on commit 7f12994

Please sign in to comment.