I know how to do it
$ (gif). Show (); $ Post (action, data, function (result) {$ (gif) .hide ();}); // is also a better way to use ajaxStart and ajaxStop
But, I do not know how to do without using the post, I tried
$ (gif) .show (); DoAction (); // There are no posts ... $ (gif) .hide ();
The problem is, while the doAction function is running $ (gif) is not visible .... I also tried with timeout , but The problem is this that ends either before or after the period of doAction () ...
It should work, if any doAction ()
is synchronous.
If it is not, you will need to call the hidden method in the callback, when the operation (if any) will end.
Comments
Post a Comment