Example for adding JQuery AJAX parameters: jqueryajax

Source: Internet
Author: User

Example for adding JQuery AJAX parameters: jqueryajax

Context

Type: Object

This object is used to set the context of Ajax-related callback functions. That is to say, let this in the callback function point to this object (if this parameter is not set, this points to the options parameter passed when this AJAX request is called ). For example, if you specify a DOM element as the context parameter, the context of the success callback function is set to this DOM element.

Like this:

$. Ajax ({url: "test.html", context: document. body, success: function (){
$ (This). addClass ("done ");
}});

JsonpCallback

Type: String

Specify a callback function name for the jsonp request. This value is used to replace the random function name automatically generated by jQuery. This function is mainly used to make jQuery generate a unique function name, which makes it easier to manage requests and conveniently provide callback functions and error handling. You can also specify the callback function name when you want the browser to cache the GET request.

Xhr

Type: Function

You need to return an XMLHttpRequest object. ActiveXObject in IE and XMLHttpRequest in other cases by default. Used to override or provide an enhanced XMLHttpRequest object. This parameter is unavailable before jQuery 1.3.

Timeout

Type: Number

Set the request timeout (in milliseconds ). This setting overwrites the global setting.


Parameters passed by jquery ajax

Type: "POST"
Because type is post ~ Asp can be processed just like a normal form commit .. The transmitted transmission is directly received using request ~
In your case ~ The result you have processed ~
Finally, output 000 to 002 and so on ..

Jquery ajax example

This example is very troublesome. It involves html pages, php pages, and databases. It is recommended that you take a look at the jquery manual, which describes how to use ajax, as well as examples.
Data is sent to the php end through ajax, php is processed, and then sent to ajax. After ajax receives the data, it is the common variable in js, and js places the data to the corresponding location on the page.

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.