1. Load ()
The load () method is typically used to obtain a static data file from the server.
If you need to pass some parameters to the server in your project, you can use the $.get () or $.post () method or the $.ajax () method
2, $.get ()
$.get () uses the Get method to make an asynchronous request with a structure of $.get (Url,[data],[callback]);
Description: URL is the request address,
Data is requested, can be in the object ({key:value}) format, or can be stitched to the back of the URL,
Callback is the callback function after the request succeeds, the server returns a string
function(data) {
The returned data is a string type
});
3. Post ()
$.post (Url,[data],[callback],[type])
Description: This function is similar to the $.get () parameter, has a type parameter, type is the requested data type, can be a type of Html,xml,json, if we set this parameter to: JSON, then the returned format is in JSON format, if not set, and $. Get () returns the same format as the string.
$.post ("data.php", data, function(data) { $ ("#postResponse"). HTML (data.name);},"JSON"); Sets the type of data obtained, so the resulting data format is a JSON-type
jquery Ajax's use of load, post, get, put, delete