callback function
If you are working with $.ajax () data, you need to use a callback function. Beforesend, error, Datafilter, success, complete.
- Beforesend is called before the request is sent, and a xmlhttprequest is passed in as a parameter.
- Error is called when the request is faulted. Incoming XMLHttpRequest object, a string describing the type of error, and an exception object (if any)
- Datafilter is called after the request succeeds. The returned data is passed in as well as the value of the "DataType" parameter. and the new data (possibly processed) must be returned to the success callback function.
- Success called after the request. The data after the incoming return, and the string containing the success code.
- Complete the function is called after the request is completed, regardless of success or failure. The incoming XMLHttpRequest object, and a string containing the success or error code.
Source: http://www.cnblogs.com/haha12/p/4727443.html
Null
Ajax callback function