Skip to content

Commit a7d8ab8

Browse files
committed
Ref gh-240, jQuery 1.9 wants document for ajax events.
1 parent bbd0155 commit a7d8ab8

6 files changed

Lines changed: 6 additions & 6 deletions

File tree

entries/ajaxComplete.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
$( ".result" ).load( "ajax/test.html" );
2626
});</code></pre>
2727
<p>When the user clicks the element with class <code>trigger</code> and the Ajax request completes, the log message is displayed.</p>
28-
<p><strong>Note:</strong> Because <code>.ajaxComplete()</code> is implemented as a method of jQuery object instances, you can use the <code>this</code> keyword to refer to the selected elements within the callback function. <strong>As of jQuery 1.8, however, the <code>.ajaxComplete()</code> method should only be attached to <code>document</code>.</strong></p>
28+
<p><strong>As of jQuery 1.8, the <code>.ajaxComplete()</code> method should only be attached to <code>document</code>.</strong></p>
2929
<p>All <code>ajaxComplete</code> handlers are invoked, regardless of what Ajax request was completed. If you must differentiate between the requests, use the parameters passed to the handler. Each time an <code>ajaxComplete</code> handler is executed, it is passed the event object, the <code>XMLHttpRequest</code> object, and the settings object that was used in the creation of the request. For example, you can restrict the callback to only handling events dealing with a particular URL:</p>
3030
<pre><code>$(document).ajaxComplete(function(event, xhr, settings) {
3131
if ( settings.url === "ajax/test.html" ) {

entries/ajaxError.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
$( "div.result" ).load( "ajax/missing.html" );
2424
});</code></pre>
2525
<p>When the user clicks the button and the Ajax request fails, because the requested file is missing, the log message is displayed.</p>
26-
<p><strong>Note:</strong> Because <code>.ajaxError()</code> is implemented as a method of jQuery object instances, you can use the <code>this</code> keyword within the callback function to refer to the selected elements. <strong>As of jQuery 1.8, however, the <code>.ajaxError()</code> method should only be attached to <code>document</code>.</strong></p>
26+
<p><strong>As of jQuery 1.8, the <code>.ajaxError()</code> method should only be attached to <code>document</code>.</strong></p>
2727
<p>All <code>ajaxError</code> handlers are invoked, regardless of what Ajax request was completed. To differentiate between the requests, use the parameters passed to the handler. Each time an <code>ajaxError</code> handler is executed, it is passed the event object, the <code>jqXHR</code> object (prior to jQuery 1.5, the <code><abbr title="XMLHttpRequest">XHR</abbr></code> object), and the settings object that was used in the creation of the request. If the request failed because JavaScript raised an exception, the exception object is passed to the handler as a fourth parameter. For example, to restrict the error callback to only handling events dealing with a particular URL:</p>
2828
<pre><code>$( document ).ajaxError(function(event, jqxhr, settings, exception) {
2929
if ( settings.url == "ajax/missing.html" ) {

entries/ajaxSend.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
$( ".result" ).load( "ajax/test.html" );
2424
});</code></pre>
2525
<p>When the user clicks the element with class <code>trigger</code> and the Ajax request is about to begin, the log message is displayed.</p>
26-
<p><strong>Note:</strong> Because <code>.ajaxSend()</code> is implemented as a method of jQuery instances, you can use the <code>this</code> keyword to refer to the selected elements within the callback function. <strong>As of jQuery 1.8, however, the <code>.ajaxSend()</code> method should only be attached to <code>document</code>.</strong></p>
26+
<p><strong>As of jQuery 1.8, the <code>.ajaxSend()</code> method should only be attached to <code>document</code>.</strong></p>
2727
<p>All <code>ajaxSend</code> handlers are invoked, regardless of what Ajax request is to be sent. If you must differentiate between the requests, use the parameters passed to the handler. Each time an <code>ajaxSend</code> handler is executed, it is passed the event object, the <code>jqXHR</code> object (in version 1.4, <code>XMLHttpRequest</code>object), and the <a href="http://api.jquery.com/jQuery.ajax/">settings object</a> that was used in the creation of the Ajax request. For example, you can restrict the callback to only handling events dealing with a particular URL:</p>
2828
<pre><code>$(document).ajaxSend(function(event, jqxhr, settings) {
2929
if ( settings.url == "ajax/test.html" ) {

entries/ajaxStart.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
$( ".result" ).load("ajax/test.html");
2424
});</code></pre>
2525
<p>When the user clicks the element with class <code>trigger</code> and the Ajax request is sent, the log message is displayed.</p>
26-
<p><strong>Note:</strong> Because <code>.ajaxStart()</code> is implemented as a method of jQuery object instances, you can use the <code>this</code> keyword to refer to the selected elements within the callback function. <strong>As of jQuery 1.8, however, the <code>.ajaxStart()</code> method should only be attached to <code>document</code>.</strong></p>
26+
<p><strong>As of jQuery 1.8, the <code>.ajaxStart()</code> method should only be attached to <code>document</code>.</strong></p>
2727
</longdesc>
2828
<note id="ajax-global-false" type="additional" data-title=".ajaxStart()"/>
2929
<example>

entries/ajaxStop.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
$( ".result" ).load( "ajax/test.html" );
2424
});</code></pre>
2525
<p>When the user clicks the element with class <code>trigger</code> and the Ajax request completes, the log message is displayed.</p>
26-
<p>Because <code>.ajaxStop()</code> is implemented as a method of jQuery object instances, you can use the <code>this</code> keyword to refer to the selected elements within the callback function. <strong>As of jQuery 1.8, however, the <code>.ajaxStop()</code> method should only be attached to <code>document</code>.</strong></p>
26+
<p><strong>As of jQuery 1.8, the <code>.ajaxStop()</code> method should only be attached to <code>document</code>.</strong></p>
2727
</longdesc>
2828
<note id="ajax-global-false" type="additional" data-title=".ajaxStop()"/>
2929
<example>

entries/ajaxSuccess.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
$( ".result" ).load( "ajax/test.html" );
2424
});</code></pre>
2525
<p>When the user clicks the element with class <code>trigger</code> and the Ajax request completes successfully, the log message is displayed.</p>
26-
<p><strong>Note:</strong> Because <code>.ajaxSuccess()</code> is implemented as a method of jQuery object instances, use the <code>this</code> keyword to refer to the selected elements within the callback function. <strong>As of jQuery 1.8, however, the <code>.ajaxSuccess()</code> method should only be attached to <code>document</code>.</strong></p>
26+
<p><strong>As of jQuery 1.8, the <code>.ajaxSuccess()</code> method should only be attached to <code>document</code>.</strong></p>
2727
<p>All <code>ajaxSuccess</code> handlers are invoked, regardless of what Ajax request was completed. If you must differentiate between the requests, you can use the parameters passed to the handler. Each time an <code>ajaxSuccess</code> handler is executed, it is passed the event object, the <code>XMLHttpRequest</code> object, and the settings object that was used in the creation of the request. For example, you can restrict the callback to only handling events dealing with a particular URL:</p>
2828
<pre><code>$(document).ajaxSuccess(function(event, xhr, settings) {
2929
if ( settings.url == "ajax/test.html" ) {

0 commit comments

Comments
 (0)