Skip to content

Commit 2f66d1d

Browse files
committed
Add note to global ajax event method about effect of global:false
* Fixes jquery#138
1 parent 4cc3694 commit 2f66d1d

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
@@ -35,6 +35,7 @@
3535
}
3636
});</code></pre>
3737
</longdesc>
38+
<note id="ajax-global-false" type="additional" data-title=".ajaxComplete()"/>
3839
<example>
3940
<desc>Show a message when an Ajax request completes.</desc>
4041
<code><![CDATA[$("#msg").ajaxComplete(function(event,request, settings){

entries/ajaxError.xml

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
}
3232
});</code></pre>
3333
</longdesc>
34+
<note id="ajax-global-false" type="additional" data-title=".ajaxError()"/>
3435
<example>
3536
<desc>Show a message when an Ajax request fails.</desc>
3637
<code><![CDATA[$("#msg").ajaxError(function(event, request, settings){

entries/ajaxSend.xml

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
}
3232
});</code></pre>
3333
</longdesc>
34+
<note id="ajax-global-false" type="additional" data-title=".ajaxSend()"/>
3435
<example>
3536
<desc>Show a message before an Ajax request is sent.</desc>
3637
<code><![CDATA[$("#msg").ajaxSend(function(evt, request, settings){

entries/ajaxStart.xml

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
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>
2626
<p><strong>Note:</strong> Because <code>.ajaxStart()</code> is implemented as a method of jQuery object instances, we can use the <code>this</code> keyword as we do here to refer to the selected elements within the callback function.</p>
2727
</longdesc>
28+
<note id="ajax-global-false" type="additional" data-title=".ajaxStart()"/>
2829
<example>
2930
<desc>Show a loading message whenever an Ajax request starts (and none is already active).</desc>
3031
<code><![CDATA[$("#loading").ajaxStart(function(){

entries/ajaxStop.xml

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
<p>When the user clicks the element with class <code>trigger</code> and the Ajax request completes, the log message is displayed.</p>
2626
<p>Because <code>.ajaxStop()</code> is implemented as a method of jQuery object instances, we can use the <code>this</code> keyword as we do here to refer to the selected elements within the callback function.</p>
2727
</longdesc>
28+
<note id="ajax-global-false" type="additional" data-title=".ajaxStop()"/>
2829
<example>
2930
<desc>Hide a loading message after all the Ajax requests have stopped.</desc>
3031
<code><![CDATA[$("#loading").ajaxStop(function(){

entries/ajaxSuccess.xml

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
}
3434
});</code></pre>
3535
</longdesc>
36+
<note id="ajax-global-false" type="additional" data-title=".ajaxSuccess()"/>
3637
<example>
3738
<desc>Show a message when an Ajax request completes successfully.</desc>
3839
<code><![CDATA[$("#msg").ajaxSuccess(function(evt, request, settings){

notes.xsl

+3
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@
3434
<xsl:when test="@id = 'use-ajaxerror'">
3535
If a request with <xsl:value-of select="@data-title"/> returns an error code, it will fail silently unless the script has also called the global <a href="http://api.jquery.com/ajaxError/">.ajaxError() </a> method. Alternatively, as of jQuery 1.5, the <code>.error()</code> method of the <code>jqXHR</code> object returned by <xsl:value-of select="@data-title"/> is also available for error handling.
3636
</xsl:when>
37+
<xsl:when test="@id = 'ajax-global-false'">
38+
If <code><a href="/jQuery.Ajax/">$.ajax()</a></code> or <code><a href="/jQuery.ajaxSetup/">$.ajaxSetup()</a></code> is called with the <code>global</code> option set to <code>false</code>, the <code><xsl:value-of select="@data-title"/></code> method will not fire.
39+
</xsl:when>
3740
</xsl:choose>
3841
</xsl:template>
3942
</xsl:stylesheet>

0 commit comments

Comments
 (0)