Tuesday, October 16, 2012

jQuery ajaxStart


The jQuery ajaxStart event gets fired when the first Ajax requests is initialed in a page, it does not fire when every individual request starts but gets fired only when the first request is fired in the page.

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 ajaxStart event handler is as follows.
ajaxStart(function())

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

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

Search Flipkart Products:
Flipkart.com

No comments: