Skip to content

Commit 3c1c919

Browse files
committed
jQuery.get:jQuery.post: Document issues with data: null with 3 params
In jQuery 3.x and older, when providing a `null` value for `success` you also have to provide the `data` parameter; you can set it to `undefined`. Document this restriction of `jQuery.get` & `jQuery.post`. Ref jquery/jquery#4989 Ref jquery/jquery#5139
1 parent fbc2602 commit 3c1c919

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

entries/jQuery.get.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<argument name="data" type="PlainObject" />
1616
<argument name="textStatus" type="String"/>
1717
<argument name="jqXHR" type="jqXHR"/>
18-
<desc>A callback function that is executed if the request succeeds. Required if <code>dataType</code> is provided, but you can use <code>null</code> or <a href="/jQuery.noop/"><code>jQuery.noop</code></a> as a placeholder.</desc>
18+
<desc>A callback function that is executed if the request succeeds. Required if <code>dataType</code> is provided, but you can use <code>null</code> or <a href="/jQuery.noop/"><code>jQuery.noop</code></a> as a placeholder. <strong>NOTE:</strong> In jQuery 3.x and older, when providing a <code>null</code> value for <code>success</code> you also have to provide the <code>data</code> parameter; you can set it to <code>undefined</code>.</desc>
1919
</argument>
2020
<argument name="dataType" optional="true" type="String">
2121
<desc>The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html).</desc>

entries/jQuery.post.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<argument name="data" type="PlainObject" />
1616
<argument name="textStatus" type="String"/>
1717
<argument name="jqXHR" type="jqXHR"/>
18-
<desc>A callback function that is executed if the request succeeds. Required if <code>dataType</code> is provided, but can be <code>null</code> in that case.</desc>
18+
<desc>A callback function that is executed if the request succeeds. Required if <code>dataType</code> is provided, but can be <code>null</code> or <a href="/jQuery.noop/"><code>jQuery.noop</code></a> as a placeholder. <strong>NOTE:</strong> In jQuery 3.x and older, when providing a <code>null</code> value for <code>success</code> you also have to provide the <code>data</code> parameter; you can set it to <code>undefined</code>.</desc>
1919
</argument>
2020
<argument name="dataType" optional="true" type="String">
2121
<desc>The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html).</desc>

0 commit comments

Comments
 (0)