Ajaxsetup Setting the default value for AJAX requests

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.