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