ajax


  1. beforeSend is called before the request is sent, and is passed the XMLHttpRequestobject as a parameter.
  2. error is called if the request fails. It is passed the XMLHttpRequest, a string indicating the error type, and an exception object if applicable.
  3. dataFilter is called on success. It is passed the returned data and the value ofdataType, and must return the (possibly altered) data to pass on to success.
  4. success is called if the request succeeds. It is passed the returned data, a string containing the success code, and the XMLHttpRequest object.
  5. complete is called when the request finishes, whether in failure or success. It is passed the XMLHttpRequest object, as well as a string containing the success or error code.

beforeSend 는 서버로 요청을 보내기전 호출됩니다.
error는 호출에 실패하였을때 호출됩니다.
dataFilter 는 ajax를 호출할때 파라미터로 dataType이라는것을 넘겨주게 되는데 이값을 검사하여 호출됩니다.
success 는 서버에서 데이터를 잘 받았을때 호출됩니다.
complate는 성공이나 실패가나더라도.. 요청이 완료된 상태에서 호출이 됩니다.

댓글

이 블로그의 인기 게시물

jquery css

Struts2의 작동 원리

JSP/Servlet 한글 깨짐 처리 ?