Tuesday, October 16, 2012

jQuery ajaxStop


The jQuery ajaxStop event gets fired when all the Ajax requests in the page have completed, it does not fire when an individual request gets completed but waits for all the ajax request in the page to get completed.

This event can be typically used to show / hide loading.. indicators in a page which has multiple Ajax request executing simultaneously.

The ajaxStart event handler can be used to show the Loading.. indicator and the ajaxStop handler can be used to hide the Loading.. indicator.

The syntax for the ajaxStop event handler is as follows.

ajaxStop(function())

Example
$("#divLoading").ajaxStart(function(){
      $(this).show();
});

$("#divLoading").ajaxStop(function(){
      $(this).hide();

Search Flipkart Products:
Flipkart.com

No comments: