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):XHRThis 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)]):XHRAsynchronously requests the specified
url, adding anydatathat is specified. When the response is received, parses it as JSON, and passes the resulting object to the callback ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access