docs: function doXHR(url, method, data, headers, withCredentials, success, fail) {
          var req = support.getXHR();
          req.open(method, url, true);
          req.onreadystatechange = function () {
              var status;
              if (req.readyState === 4) { // DONE
                  // remove the onreadystatechange handler,
                  // because it could be called again
                  // @NOTE: we replace it with a noop function, because
                  // IE8 will throw an error if the value is not of type
                  // 'function' when using ActiveXObject
                  req.onreadystatechange = function () {};
  
                  try {
                      status = req.status;
                  } catch (e) {
                      // NOTE: IE (9?) throws an error when the request is aborted
                      fail(req);
                      return;
                  }
  
                  // status is 0 for successful local file requests, so assume 200
                  if (status === 0 && isRequestToLocalFile(url)) {
                      status = 200;
                  }
  
                  if (isSuccessfulStatusCode(status)) {
                      success(req);
                  } else {
                      fail(req);
                  }
              }
          };
          setHeaders(req, headers);
  
          // this needs to be after the open call and before the send call
          req.withCredentials = withCredentials;
  
          req.send(data);
          return req;
      }