The Ajaxsetup () method sets the default value for future AJAX requests.
Grammar
$.ajaxsetup ({name:value, Name:value, ...})
This parameter specifies the setting for AJAX requests with one or more name/value pairs.
The possible names/values are listed in the following table:
Name Value/Description
An async Boolean value that indicates whether the request is processed asynchronously. The default is true.
Beforesend (XHR) The function that runs before the request is sent.
The cache Boolean value that indicates whether the browser caches the requested page. The default is true.
The function that is run when complete (Xhr,status) requests are completed (called after the request succeeds or fails, that is, after the success and the error function).
ContentType the type of content to use when sending data to the server. The default is: "Application/x-www-form-urlencoded".
The context specifies the "this" value for all AJAX-related callback functions.
Data is defined to be sent to the server.
Datafilter (Data,type) functions for handling XMLHttpRequest raw response data.
DataType the data type of the expected server response.
Error (XHR,STATUS,ERROR) If the request fails the function to run.
Global Boolean value that specifies whether to trigger an overall AJAX event handler for the request. The default is true.
Ifmodified Boolean value that specifies whether the request succeeds only if the response has changed since the last request. The default is False.
Jsonp A string that overrides the callback function in a JSONP.
JSONPCALLBACK Specifies the name of the callback function in a JSONP.
password Specifies the password that is used in HTTP access authentication requests.
ProcessData Boolean value that specifies whether the data sent through the request is converted to a query string. The default is true.
SCRIPTCHARSET specifies the requested character set.
Success (RESULT,STATUS,XHR) The function that runs when the request succeeds.
Timeout sets the local request time-out (in milliseconds).
Traditional Boolean value that specifies whether to use the traditional style of parameter serialization.
Type specifies the kind of request (GET or POST).
The URL specifies the URL to send the request. The default is the current page.
USERNAME Specifies the user name to use in HTTP access authentication requests.
XHR the function used to create the XMLHttpRequest object.
Ajaxsetup Setting the default value for AJAX requests