Is there is a way to monitor all Ajax requests made using JQuery on WooCommerce?
I’m trying to detect which Ajax event on WooCommerce cart page causes an infinite loop sometimes on My WordPress webSite.
Is there is a way to monitor all Ajax requests made using JQuery on WooCommerce?
I’m trying to detect which Ajax event on WooCommerce cart page causes an infinite loop sometimes on My WordPress webSite.
2
Answers
You can try the ajaxstart event provided by jquery itself. Jquery triggers this event whenever it sends any ajax request.
#Hope this will help you, Thanks.
You can use:
ajaxSend()
that attach a function to be executed before an Ajax request is sent,ajaxComplete()
that register a handler to be called when Ajax requests complete.Both gives details related to the Ajax event that is triggered on a readable XHR Object in your browser Javascript console.
Here is a code example, that displays Ajax triggered request details:
Code goes in functions.php file of the active child theme (or active theme). Tested and works.
After checkout page load for example you will get something like:
Related: Monitoring all AJAX requests made by JQuery?