Jquery encapsulates some ajax request methods, which are very practical and can be sorted out and shared with you. If you are interested, refer to the following, I hope it can help you encapsulate some ajax request methods in jquery, which is very practical.
For example
. AjaxComplete () -- when the request is complete
. AjaxError () -- when the request fails
. AjaxSend () -- append a function to execute the Ajax request.
. AjaxStart () -- when the request starts,
. AjaxStop () -- end of request
. AjaxSuccess () -- when the request is successful
. Load () -- load data from the server and replace the returned HTML with the selected element.
JQuery. post () -- use http post requests to load server data
. Serialize () -- encode the form element set into a string for submission
. SerializeArray () -- encode the form Element Set into an array of key-value pairs
JQuery. param () -- creates a serialized array or object that is applicable to a URL query string or Ajax request.
JQuery. getScript () -- load a js file from the server and execute it
JQuery. getJSON () -- load JSON-encoded data from the server
JQuery. get () -- load data from the server. In short, there are two points.
I.. ajaxStart () and. ajaxStop ()
The Code is as follows: