$ (Selector). load (Url [, date] [, callback])
Url: the url of the Request page.
Date: key: value data sent to the server
Callback: the callback function when the request is complete. no matter whether the request is successful or fails, it is called when the XMLHttpRequest object is in the status of 4 or complete.
This function inserts the content returned by ajax into the selector as innerHTML. If necessary, you can add parameters after the url to filter the content to be inserted.
If the date parameter exists, it is sent in POST mode; otherwise, it is sent in GET mode. The format of date data is {key1: value1, key2: value2 ...}
The callback function automatically passes in three parameters: returned content, Request status, and XMLHttpRequest object. The Request status refers to the status returned by the server, rather than the XMLHttpRequest object. The Request status is divided into four states: success, error, notmodified, and timeout.
$. Get (Url [, date] [, callback] [, type])
Url: the url of the Request page.
Date: key: value data sent to the server. Format: {key1: value1, key2: value2 ...}
Callback: the callback function when the load is successful, that is, when the server returns status 200. Two parameters are automatically input. The first parameter is the returned content, and the second parameter is the Request status.
Type: it does not seem to work much.
This function will send data in GET Mode
$. Post (Url [, date] [, callback] [, type])
The usage is the same as the $. get method, except that the method for sending data is POST.
$. GetScript (Url [, callback])
Functions used to dynamically load js scripts
Url: url of the script to be loaded
Callback: the callback function after the script is loaded successfully.
$. GetJSON (Url [, callback])
Functions used to load json files
Url: url of the json file to be loaded
Callback: the callback function after the json file is successfully loaded. A parameter, namely, a json object, is automatically input.
$. Ajax (Opitions)
Opitions is a key: value object, which specifies various parameters. Common parameters include:
Url:
Type:
Timeout:
Date:
Datetype:
BeforeSend:
Complete:
Success:
Error:
For more information about jquery, see the reference manual. This function is unlikely to be used.
$. Each (Objecy/array, callback)
A function used to traverse arrays or objects. This function can only traverse one layer. to traverse multiple layers, you must use it again.
Object/array: array or object to be traversed
Callback: The operation function will automatically pass in two parameters. The first is the object's member or array index, and the second is the specific content.