code: function (uri, location) {
              var uriCheck = this._uriScheme.exec(uri.toLowerCase());
  
              if (uriCheck && location) {
                  var scheme = uriCheck[1], authority = uriCheck[2];
  
                  if (this._uriLocal.test(scheme)) {
                      return this.__local;
                  } else if (scheme != location.protocol || authority != location.host) {
                      // Having different protocol or host we must use XDR
                      return this.__crossDomain;
                  }
              }
  
              // For any other request go for XHR
              return this.__sameDomain;
          }
docs: Get the correct transport for the uri. It uses the Location argument to distinguish between XHR and XDR
  @param {String} uri URI of the request
  @param {Object} location Location object as in window.location or null if not run in a browser
  
  <pre>
  {
  protocol: the protocol of the URL
  host: the hostname and port number
  }
  </pre>
  
  @return {String} Transport class classpath
  @protected