Skip to content

Document jQuery.ready #983

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions entries/jQuery.holdReady.xml
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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>