bapp07.indd 02/17/2015 Page 533
AJAX Methods
METHOD DESCRIPTION RETURN VALUEAJAX REQUESTS$.ajax([options])
$.ajax(url[, options])Allows you to pass an object lit-
eral specifying various options in
key, value pairs. For the complete
list of options, see the “AJAX
Options” table. This method is
used by jQuery’s other AJAX
methods to make AJAX requests.
You should use this method only if
you require fi ner-grained control
over an AJAX request than is pos-
sible with jQuery’s other methods.jQuery
XMLHttpRequestajaxComplete(function()) Attaches a function to be exe-
cuted when an AJAX request is
completed.jQueryajaxError(function()) Attaches a function that is exe-
cuted when an error occurs.jQuery$.ajaxPrefilter(
[dataTypes],
function()
)The dataTypes argument is
optional and should contain
one or more space-separated
dataTypes.
The callback function argument
sets default values for future
AJAX requests. Its argument list
is options, originalOptions,
jqXHR.Undefi nedG
continues