0

I need to show a symbol/message or spinner if any request start in the network tab

i can do that with

$( document ).ajaxSend(function() {

or

$( document ).ajaxComplete(function() {

and i can track clicks on a href or buttons

but instead of changing the entire code to track, is it possible to track if there is a new request in the network tab

i want to track it with javascript but if there is a library or something i don't mind using it

Y.G.J
  • 1,098
  • 5
  • 19
  • 44
  • 1
    _and i can track clicks on a href or buttons.._ Nope, with that you just can track AJAX calls initiated by jquery's [Ajax methods](http://api.jquery.com/category/ajax/). – hindmost Nov 01 '18 at 09:41
  • 2
    *if any request start in the network tab* You can't do this. If you use some kind of client side framework, like Ember or [Angular](https://stackoverflow.com/questions/45323108/show-a-loading-gif-for-each-http-request-angular-4) you could(ish). But that's going to involve rewriting your entire front end. – Liam Nov 01 '18 at 09:43
  • 2
    You cannot track _all_ network activity with javascript. The only way to do such things in a browser is browser's extension. – hindmost Nov 01 '18 at 09:48

0 Answers0