Ajax requests produce a wide variety of distinctive occasions that you can subscribe to. Here's a full listing of the activities and in what order they are triggered.

There are 2 types of events in Ajax
  • Local Events: Local Events are callbacks that you can subscribe to inside the Ajax request object.
  • Global Events: Global events are triggered on the document, calling any handlers who may be listening.
BY Best Interview Question ON 08 Mar 2020

Example

Example of Local Events

$.ajax({
    beforeSend: function(){

    },
    complete: function(){

    }
});

Example of Global Events

$.ajax({
   url: "bestinterviewquestion.html",
   global: false,
});