Google News
logo
jQuery - Interview Questions
Elaborate jQuery Ajax Events.
Ajax methods trigger an event handler that results in jQuery Ajax Events. Some of the examples of jQuery Ajax Events are as listed below.
 
These events are categorized into local events and global events.
 
1. ajaxStart() : It is a Global Event, This event triggers as a result of starting of an Ajax request, provided no other Ajax request currently running.

2. beforeSend() : It is a Local Event, as the name indicates, this event gets invoked before Ajax request starts, thereby allowing to modify XMLHttpRequest objects.

3. ajaxSend() : It is a Global Event, and this event gets called before the Ajax request is run.

4. success() : It is a Local Event. This event triggers only if the Ajax request was successfully sent ( i.e. while sending Ajax request, the event does not display any error from the server or from data).

5. ajaxSuccess() : It is a Global Event, triggers only if the request sent was successful.

6. error() : It is a Local Event, that gets triggered if an error occurs while executing the request. (You can have either error or a success callback while sending Ajax request)

7. ajaxError() : It is a Global Event, which behaves the same as its local counterpart error() event.

8. complete() : It is a Local Event. This event gets called regardless of the request being successful or result in an error, and complete callbacks are received, even for synchronous requests.

9. ajaxComplete() : It is a Global Event, which behaves the same as its local counterpart complete() event, even for synchronous requests.

10. ajaxStop() : It is a Global Event, that gets triggered when no Ajax requests are still being processed/ pending for processing.
Advertisement