Skip to content
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
14 changes: 14 additions & 0 deletions categories.xml
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,13 @@ var files = event.originalEvent.dataTransfer.files;
<hr/>
]]></desc>
</category>
<category name="Version 3.8" slug="3.8">
<desc><![CDATA[
<div id="version-support-warning" class="warning"><i class="icon-info-sign"></i> <span>This version has not been released yet. Behavior may change before the final release.</span></div>
<p>All the aspects of the API that were added, or had a new signature added, in the corresponding version of jQuery.</p>
<hr/>
]]></desc>
</category>
<category name="Version 4.0" slug="4.0">
<desc><![CDATA[
<p>Aspects of the API that were changed in the corresponding version of jQuery.</p>
Expand All @@ -629,6 +636,13 @@ var files = event.originalEvent.dataTransfer.files;
<hr/>
]]></desc>
</category>
<category name="Version 4.1" slug="4.1">
<desc><![CDATA[
<div id="version-support-warning" class="warning"><i class="icon-info-sign"></i> <span>This version has not been released yet. Behavior may change before the final release.</span></div>
<p>All the aspects of the API that were added, or had a new signature added, in the corresponding version of jQuery.</p>
<hr/>
]]></desc>
</category>
<category name="All" slug="all"/>
</category>
</categories>
4 changes: 4 additions & 0 deletions entries/jQuery.ajax.xml
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,9 @@ jqxhr.always(function() {
<li>
<code>responseXML</code> and/or <code>responseText</code> when the underlying request responded with xml and/or text, respectively
</li>
<li>
<code>responseURL</code> (<strong>as of jQuery 4.1</strong>) is the final URL of the response after any redirects, when the underlying transport reports it. For XMLHttpRequest-based requests in modern browsers, this mirrors <code>XMLHttpRequest.responseURL</code>; for script, JSONP, aborted, or otherwise unsupported requests it is <code>undefined</code>.
</li>
<li>
<code>status</code>
</li>
Expand Down Expand Up @@ -464,4 +467,5 @@ $.ajax({
<category slug="version/1.5.1"/>
<category slug="version/3.5"/>
<category slug="version/3.6"/>
<category slug="version/4.1"/>
Comment thread
timmywil marked this conversation as resolved.
</entry>
20 changes: 16 additions & 4 deletions entries/jQuery.ajaxTransport.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,23 @@ $.ajaxTransport( dataType, function( options, originalOptions, jqXHR ) {
<li><code>headers</code> is an object of (key-value) request headers that the transport can transmit if it supports it</li>
<li><code>completeCallback</code> is the callback used to notify Ajax of the completion of the request</li>
</ul>
<p><code>completeCallback</code> has the following signature:</p>
<p>As of jQuery 3.8 and 4.1 (excluding jQuery 4.0), <code>completeCallback</code> accepts a single params object:</p>
<pre><code>
function( status, statusText, responses, headers ) {}
function( params ) {}
</code></pre>
<p>where:</p>
<p>with the following properties:</p>
<ul>
<li><code>status</code> is the HTTP status code of the response, like 200 for a typical success, or 404 for when the resource is not found.</li>
<li><code>statusText</code> is the statusText of the response.</li>
<li><code>responses</code> (Optional) is An object containing dataType/value that contains the response in all the formats the transport could provide (for instance, a native XMLHttpRequest object would set responses to <code>{ xml: XMLData, text: textData }</code> for a response that is an XML document)</li>
<li><code>headers</code> (Optional) is a string containing all the response headers if the transport has access to them (akin to what <code>XMLHttpRequest.getAllResponseHeaders()</code> would provide).</li>
<li><code>responseURL</code> (Optional) is the final URL of the response after any redirects, if the transport has access to it (akin to what <code>XMLHttpRequest.responseURL</code> would provide). It is exposed on the jqXHR object as <code>jqXHR.responseURL</code>. <strong>Added in jQuery 4.1.</strong></li>
</ul>
<p>An older, positional-arguments form is also supported, but limited to the following four parameters:</p>
<pre><code>
function( status, statusText, responses, headers ) {}
</code></pre>
<p>The parameters have the same meaning as the object properties described above. Both calling conventions are supported; jQuery detects which one is used by checking whether the first argument is an object.</p>
<p>Just like prefilters, a transport's factory function can be attached to a specific dataType:</p>
<pre><code>
$.ajaxTransport( "script", function( options, originalOptions, jqXHR ) {
Expand All @@ -70,7 +76,11 @@ $.ajaxTransport( "image", function( s ) {
var statusText = ( status === 200 ) ? "success" : "error",
tmp = image;
image = image.onreadystatechange = image.onerror = image.onload = null;
callback( status, statusText, { image: tmp } );
callback( {
status: status,
statusText: statusText,
responses: { image: tmp }
} );
}
}
image.onreadystatechange = image.onload = function() {
Expand Down Expand Up @@ -128,4 +138,6 @@ jQuery.ajaxSetup({
</longdesc>
<category slug="ajax/low-level-interface"/>
<category slug="version/1.5"/>
<category slug="version/3.8"/>
<category slug="version/4.1"/>
</entry>