Skip to content

Commit 07b3ad7

Browse files
committed
Added note for Global Ajax Event Handlers
Fixes jquerygh-479 Closes jquerygh-797
1 parent a32c847 commit 07b3ad7

File tree

7 files changed

+9
-0
lines changed

7 files changed

+9
-0
lines changed

entries/ajaxComplete.xml

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ $( document ).ajaxComplete(function( event, xhr, settings ) {
4444
</code></pre>
4545
<p><strong>Note:</strong> You can get the returned ajax contents by looking at <code>xhr.responseText</code>.</p>
4646
</longdesc>
47+
<note id="global-ajax-event" type="additional" data-title=".ajaxComplete()"/>
4748
<note id="ajax-global-false" type="additional" data-title=".ajaxComplete()"/>
4849
<example>
4950
<desc>Show a message when an Ajax request completes.</desc>

entries/ajaxError.xml

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ $( document ).ajaxError(function( event, jqxhr, settings, thrownError ) {
4242
}
4343
});</code></pre>
4444
</longdesc>
45+
<note id="global-ajax-event" type="additional" data-title=".ajaxError()"/>
4546
<note id="ajax-global-false" type="additional" data-title=".ajaxError()"/>
4647
<example>
4748
<desc>Show a message when an Ajax request fails.</desc>

entries/ajaxSend.xml

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ $( document ).ajaxSend(function( event, jqxhr, settings ) {
4242
});
4343
</code></pre>
4444
</longdesc>
45+
<note id="global-ajax-event" type="additional" data-title=".ajaxSend()"/>
4546
<note id="ajax-global-false" type="additional" data-title=".ajaxSend()"/>
4647
<example>
4748
<desc>Show a message before an Ajax request is sent.</desc>

entries/ajaxStart.xml

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ $( ".trigger" ).click(function() {
3131
<p>When the user clicks the element with class <code>trigger</code> and the Ajax request is sent, the log message is displayed.</p>
3232
<p><strong>As of jQuery 1.8, the <code>.ajaxStart()</code> method should only be attached to <code>document</code>.</strong></p>
3333
</longdesc>
34+
<note id="global-ajax-event" type="additional" data-title=".ajaxStart()"/>
3435
<note id="ajax-global-false" type="additional" data-title=".ajaxStart()"/>
3536
<example>
3637
<desc>Show a loading message whenever an Ajax request starts (and none is already active).</desc>

entries/ajaxStop.xml

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ $( ".trigger" ).click(function() {
3131
<p>When the user clicks the element with class <code>trigger</code> and the Ajax request completes, the log message is displayed.</p>
3232
<p><strong>As of jQuery 1.8, the <code>.ajaxStop()</code> method should only be attached to <code>document</code>.</strong></p>
3333
</longdesc>
34+
<note id="global-ajax-event" type="additional" data-title=".ajaxStop()"/>
3435
<note id="ajax-global-false" type="additional" data-title=".ajaxStop()"/>
3536
<example>
3637
<desc>Hide a loading message after all the Ajax requests have stopped.</desc>

entries/ajaxSuccess.xml

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ $( document ).ajaxSuccess(function( event, xhr, settings ) {
4545
</code></pre>
4646
<p><strong>Note:</strong> You can get the returned ajax contents by looking at <code>xhr.responseXML</code> or <code>xhr.responseText</code> for xml and html respectively.</p>
4747
</longdesc>
48+
<note id="global-ajax-event" type="additional" data-title=".ajaxSuccess()"/>
4849
<note id="ajax-global-false" type="additional" data-title=".ajaxSuccess()"/>
4950
<example>
5051
<desc>Show a message when an Ajax request completes successfully.</desc>

notes.xsl

+3
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@
6767
<xsl:when test="@id = 'detach-shorthand'">
6868
As the <code>.<xsl:value-of select="@data-event"/>()</code> method is just a shorthand for <code>.on( "<xsl:value-of select="@data-event"/>", handler )</code>, detaching is possible using <code>.off( "<xsl:value-of select="@data-event"/>" )</code>.
6969
</xsl:when>
70+
<xsl:when test="@id = 'global-ajax-event'">
71+
As of jQuery 1.9, all the handlers for the <a href="/category/ajax/global-ajax-event-handlers/">jQuery global Ajax events</a>, including those added with the <code><xsl:value-of select="@data-title"/></code> method, <em>must</em> be attached to <code>document</code>.
72+
</xsl:when>
7073
</xsl:choose>
7174
</xsl:template>
7275
</xsl:stylesheet>

0 commit comments

Comments
 (0)