Web Development with jQuery®

(Elliott) #1

(^538) ❘ APPENDIX G AJAX METHODS
bapp07.indd 02/17/2015 Page 538
data The data to be sent to the server
with a GET or POST request. Can
be specifi ed as either a string of
ampersand-delimited arguments
or as an object literal in key, value
pairs. If the value is an Array,
jQuery serializes based on the
value of the traditional option.
Automatic processing of data
can be modifi ed with the
processData option.
Object,
String,
Array
dataFilter A callback function executed to
handle the raw response data of
XMLHttpRequest. This is a prefi l-
tering function used to sanitize the
response. You should return the
sanitized data from this callback
function. The function has two
arguments: responseText and
dataType.
function (responseText,
dataType)
{
// do something
// return the sanitized
// data
return data;
}
Function
dataType The type of data that you expect
to receive in your response from
the server. jQuery attempts to
automatically infer the dataType
based on the MIME type of the
data returned by the server.
See the “Data Types” table at the
end of this appendix for a list of
allowed data types.
Default value: Educated Guess
String
(continued)
http://www.it-ebooks.info

Free download pdf