The problem with your proposal is that it will not have time to execute the request until the page changes.
The browser will not wait for the completion of these two events before starting user navigation. If you are familiar with jQuery, it will be like adding a click event handler to a link, adding an ajax request to that handler, but not putting event.preventDefault() . In other words, the ajax request will not be processed as the user has already moved to the next page.
change , as you mentioned in the comments, it doesn't matter if you apply return false to the links.
If you can really click on a function like you illustrated in your example, I really donโt understand why it will not work better than with the exception that the first request is timed for some reason, forcing the user to wait far beyond limits of 100 ms, as usual.
What about users blocked by Google? There are many add-ons / programs, etc., which can completely block Google Analytics, adsense, etc. Will these users have a normal user interface?
source share