Skip to content

Commit e77a192

Browse files
committed
jQuery.ajax: Document contentType false
Added Boolean as a type for contentType. Added a sentance about what passing false does for contentType Ref gh-547 Ref gh-369
1 parent 891500f commit e77a192

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

entries/jQuery.ajax.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,10 @@
3737
<property name="contents" type="PlainObject" added="1.5">
3838
<desc>An object of string/regular-expression pairs that determine how jQuery will parse the response, given its content type.</desc>
3939
</property>
40-
<property default="'application/x-www-form-urlencoded; charset=UTF-8'" name="contentType" type="String">
41-
<desc>When sending data to the server, use this content type. Default is "application/x-www-form-urlencoded; charset=UTF-8", which is fine for most cases. If you explicitly pass in a content-type to <code>$.ajax()</code>, then it is always sent to the server (even if no data is sent). The W3C XMLHttpRequest specification dictates that the charset is always UTF-8; specifying another charset will not force the browser to change the encoding. <strong>Note:</strong> For cross-domain requests, setting the content type to anything other than <code>application/x-www-form-urlencoded</code>, <code>multipart/form-data</code>, or <code>text/plain</code> will trigger the browser to send a preflight OPTIONS request to the server.</desc>
40+
<property default="'application/x-www-form-urlencoded; charset=UTF-8'" name="contentType">
41+
<type name="Boolean"/>
42+
<type name="String"/>
43+
<desc>When sending data to the server, use this content type. Default is "application/x-www-form-urlencoded; charset=UTF-8", which is fine for most cases. If you explicitly pass in a content-type to <code>$.ajax()</code>, then it is always sent to the server (even if no data is sent). As of jQuery 1.6 you can pass <code>false</code> to tell jQuery to not set any content type header. <strong>Note:</strong> The W3C XMLHttpRequest specification dictates that the charset is always UTF-8; specifying another charset will not force the browser to change the encoding. <strong>Note:</strong> For cross-domain requests, setting the content type to anything other than <code>application/x-www-form-urlencoded</code>, <code>multipart/form-data</code>, or <code>text/plain</code> will trigger the browser to send a preflight OPTIONS request to the server.</desc>
4244
</property>
4345
<property name="context" type="PlainObject">
4446
<desc>This object will be made the context of all Ajax-related callbacks. By default, the context is an object that represents the ajax settings used in the call (<code>$.ajaxSettings</code> merged with the settings passed to <code>$.ajax</code>). For example, specifying a DOM element as the context will make that the context for the <code>complete</code> callback of a request, like so:

0 commit comments

Comments
 (0)