Ajax Functions

Most of the jQuery Ajax-related functionality takes the form of utility functions rather than methods. These are some of the most complicated functions in the jQuery library; see Chapter 6 for complete details.

Ajax status codes
success  error  notmodified  timeout  parsererror
Ajax Data Types
text   html   xml   script   json   jsonp
Ajax Events
ajaxStart    ajaxSuccess     ajaxComplete 
ajaxSend     ajaxError       ajaxStop 
Ajax Options
async       data       jsonp         timeout
beforeSend  dataFilter jsonpCallback traditional
cache       dataType   password      type
complete    error      processData   url
contentType global     scriptCharset username
context     ifModified success       xhr
jQuery.ajax(options):XHR

This is the complicated but fully general Ajax function on which all of jQuery’s Ajax utilities are based. It expects a single object argument whose properties specify all details of the Ajax request and the handling of the server’s response. The most common options are described in Common Options, and callback options are covered in Callbacks.

jQuery.ajaxSetup(options)

Sets default values for jQuery’s Ajax options. Passes the same kind of options object you would pass to jQuery.ajax(). The values you specify will be used by any subsequent Ajax request that does not specify the value itself. This function has no return value.

jQuery.getJSON(url, [data], [f(object,status)]):XHR

Asynchronously requests the specified url, adding any data that is specified. When the response is received, parses it as JSON, and passes the resulting object to ...

Get jQuery Pocket Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.