jQuery provides similar functions through the ajaxStart() and ajaxStop() methods. When an Ajax request is started and there are no other outstanding Ajax requests, the ajaxStart() method is called. Similarly, the ajaxStop() method is called when all Ajax requests are completed. The parameter of these methods is a function that will be called when the event occurs.
Example