The "ajax" function is kind of monolithic in that there are some pieces of its functionality that would prvoide some very helpful extensibility if they were separated out into other functions.
Namely, the creation of the XHR instance is embedded deep in this function, which makes overriding of that behavior (for unit testing, extensions with other XHR compatible objects, etc) nearly impossible without re-implementing the rest of the "ajax" function's logic.
Other frameworks (Dojo, YUI, Prototype, and ExtJS, for instance) all have "factory" functions which their various ajax mechanisms use to create the XHR instance to use for the request. Something very similar would be helpful with jQuery.
For instance, it could be something like:
function XHRTransport() {
return new XMLHttpRequest();
}
Obviously, that's too simple, because you'd want the already present logic of instantiating the ActiveX object for IE browsers, etc. But you get the idea, a function that returns the XHR instance and then can be used inline inside of the ajax function, without any further changes, just replacing that block of code with a call to this function.
This was discussed on the dev list and the suggestion was made to put in a ticket here, possibly for a patch or for consideration in a subsequent release.