software engineering

Intercepting XMLHttpRequest requests

By Adam K Dean on

Let's kick off the continuation of my code blogging with a very helpful little snippet. I'm just removing this from a codebase so it can sit here for eternity instead.

(function(open) { = function(method, url, async, user, pass) {
        // do some magic, method, url, async, user, pass);

This will intercept the request before it happens, and once you've done whatever changes you need to do, be it logging or tagging, you can continue it.