Bind event on ajax call wordpress

Is there any way by which I can bind a function on every ajax call and disable on response in wordpress?

(I had added loader gif just after body and I’m handling it by
show() & hide() function.)

Is this possible to show spinner gif on ajax call and disappear on responce or to do something like this?

Secondly, (if not). Is there any way to show this spinner on just when blockUi runs on checkout page?

I had wp_deregister_script('wc-checkout'); & wp_enqueue_script() my custom js in theme/woocommerce/js/checkout.js, but this is not reverting changes. So, I want to add custom function (for spinner) so that when blockUi run, it would not look weird for user and the spinner will run and disappear on unblock();

Any help would be appreciated! Thanks 🙂

Read more here: Bind event on ajax call wordpress

Leave a Reply

Your email address will not be published. Required fields are marked *