Web Development with jQuery®

(Elliott) #1

bapp07.indd 02/17/2015 Page 533


AJAX Methods


METHOD DESCRIPTION RETURN VALUE

AJAX 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
XMLHttpRequest

ajaxComplete(function()) Attaches a function to be exe-
cuted when an AJAX request is
completed.

jQuery

ajaxError(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 ned

G


continues

http://www.it-ebooks.info

Free download pdf