Skip to content

Commit 29c4c66

Browse files
committed
Add warning to $.ajaxSetup(), close gh-179.
1 parent d21726c commit 29c4c66

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

entries/jQuery.ajaxSetup.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@
77
<desc>A set of key/value pairs that configure the default Ajax request. All options are optional. </desc>
88
</argument>
99
</signature>
10-
<desc>Set default values for future Ajax requests.</desc>
10+
<desc>Set default values for future Ajax requests. Its use is not recommended.</desc>
1111
<longdesc>
1212
<p>For details on the settings available for <code>$.ajaxSetup()</code>, see <code><a href="/jQuery.ajax">$.ajax()</a></code>. </p>
1313
<p>All subsequent Ajax calls using any function will use the new settings, unless overridden by the individual calls, until the next invocation of <code>$.ajaxSetup()</code>.</p>
14+
<p><strong>Note:</strong> The settings specified here will affect <em>all</em> calls to <code>$.ajax</code> or AJAX-based derivatives such as <code>$.get()</code>. This can cause undesirable behavior since other callers (for example, plugins) may be expecting the normal default settings. For that reason we <em>strongly recommend against using this API</em>. Instead, set the options explicitly in the call or define a simple plugin to do so.</p>
1415
<p>For example, the following sets a default for the <code>url</code> parameter before pinging the server repeatedly:</p>
1516
<pre><code>$.ajaxSetup({
1617
url: 'ping.php'

0 commit comments

Comments
 (0)