Web Development with jQuery®

(Elliott) #1

(^536) ❘ APPENDIX G AJAX METHODS
bapp07.indd 02/17/2015 Page 536
async By default, jQuery sends all AJAX
requests asynchronously. To send
a synchronous request, set this
property to false.
Default value: true
Boolean
beforeSend A callback function that is exe-
cuted before the AJAX request is
sent, which can be used to modify
the jQuery XMLHttpRequest
object, as well as to set custom
headers. The arguments passed
to this function are jqXHR and
settings.
Returning false from this func-
tion cancels the request.
Function
cache If the value of the cache setting
is set to false, the browser is
forced to not cache the request.
The default value is true, false
for dataType 'script' and
'jsonp'.
Boolean
complete A function that is executed when
the AJAX request has completed
after the success or error call-
backs have been executed.
This callback is passed two argu-
ments: jqXHR and status.
The status argument will be
any of the following strings:
‘success', 'notmodified',
'error', 'timeout', 'abort',
and 'parsererror'.
Function
contents An object of string, regular
expression pairs that determine
how jQuery parses the server’s
response, given the specifi ed
dataType.
Object
(continued)
http://www.it-ebooks.info

Free download pdf