jquery each Ajax function

Source: Internet
Author: User

Query each Ajax function: $.get (), $.post (), $.ajax (), $.getjson ()

One, $.get (Url,[data],[callback])

Description: URL is the request address, data is the list of request data, callback is the callback function after the successful request, the function accepts two parameters, the first is the data returned by the server, the second parameter is the state of the server, is an optional parameter.

Ii. $.post (Url,[data],[callback],[type])

Description: Type is the requested data type, which can be html,xml,json, and so on. If not set, it is the same as the format returned by $.get (), which is a string.

SAN, $.ajax (Opiton)

$.ajax ({
URL: "Ajax/ajax_page.aspx",
Data:{key: "Value"},
Type: "POST",
DataType: ' JSON ',
Success:callbackmethod,
Error:function (Err) {
Alert ((err));
}
});

Iv. $.getjson (Url,[data],[callback])

Description: The data type obtained directly is JSON.

V. Load (URL, [data], [callback]);

Description: The URL address of the HTML page requested by the URL (String), the data (optional parameter) sent to the server's Key/value, and the callback (optional parameter) callback function (which does not need to be success) when the request is completed.

The load () method can easily load static page content into a specified jquery object. $ (' #ajax-div '). Load (' data.html ');

jquery each Ajax function

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.