JQuery Ajax Parameter Details Supplemental Sample _ajax Related

Source: Internet
Author: User
Tags error handling

Context

Type: Object

This object is used to set the context of Ajax-related callback functions. That is, let this point in the callback function refer to this object (if this argument is not set, this will point to the options argument passed when the AJAX request is invoked). For example, a DOM element is specified as the context parameter, so that the success callback function is set to this DOM element.

Just like this:

$.ajax ({url: "test.html", Context:document.body, Success:function () {
$ (this). AddClass ("Done");
}});

Jsonpcallback

Type: String

Specifies a callback function name for the JSONP request. This value will be used to replace the random function name that jQuery automatically generates. This is primarily used to allow jQuery to generate unique function names, which makes it easier to manage requests and easily provides callback functions and error handling. You can also specify this callback function name when you want the browser to cache a GET request.

Xhr

Type: Function

A XMLHttpRequest object needs to be returned. The default is ActiveXObject under IE, and in other cases it is xmlhttprequest. Used to override or provide an enhanced XMLHttpRequest object. This parameter is not available until JQuery 1.3.

Timeout

Type: Number

Sets the request timeout (in milliseconds). This setting overrides the global setting.

Related Article

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.