The use of Ajax in jquery

Source: Internet
Author: User

Statement: The material used in this column is written by the VIP students of the Kay Academy, who has the right to be anonymous and has the final right to interpret the article; The Edith Academy is designed to promote students to learn from each other on the basis of public notes.

The Ajax package of jquery works as follows:

$get $post operation is the same as the name is not the same!

The URL is the address of your visit

Data is your form.

The function callback function is to wait for your request to complete the returned data to the functions!

Datatypoe data type If you do not have a write return type on your server then you will have to write this parameter! The JSON type is returned and you write the JSON text XML

A means that the server feeds back the data if the server returns JSON then this a is a JSON object if it is a string then this is a string type B indicates the success of this Access server success indicates success! He has a third parameter, JQXHR, is the XMLHttpRequest object.

Parameter collection This could be a bit of a hassle. If you have 100 data on your form, then you have to write 100. There is a special collection of form data called serialization you can copy this to your local JS file:
Https://cdn.bootcss.com/jquery.serializeJSON/2.8.1/jquery.serializejson.min.js

After downloading this file, bring her to the lock on your page and remember that the introduction must be written in jquery under the meaning of Jqurey before introducing him!

After introduction, remember that the name of your form must be written!!!!! Then submit the current object parameters to the method to get the current object can be submitted

Return to JSON examples such as:

Request operation of Ajax

The use of Ajax in jquery

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.