Automatic show ajax loader gif image when any ajax function is called in the application

StackOverflow https://stackoverflow.com/questions/19269027

  •  30-06-2022
  •  | 
  •  

Domanda

I have many ajax calls in the application which are performing various operations, I am searching for a Jquery plugin or any other method which will detect any ajax call made and show loading image when operation is in process and hide it after operation is complete.Any help is welcome.

È stato utile?

Soluzione

Got a solution for this , I used Pretty Loader and my problem is solved .

Altri suggerimenti

$( document ).ajaxStart(function() {
    ShowLoading(1);
});
$( document ).ajaxComplete(function() {
    ShowLoading(0);
});
$.ajax({
    url: "test.html",
    context: document.body
}).beforeSend(function() {
    /* show loader */
}).success(function(){
    /* hide loader */
});
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top