+ oldStatusCode,
+
+ // Actual response
+ response;
+
+ // If we got responses:
+ // - find the right one
+ // - update dataTypes accordingly
+ // - set responseXXX accordingly too
+ if ( responses ) {
+
+ var contents = s.contents,
+ transportDataType = dataTypes[0],
+ ct,
+ type,
+ finalDataType,
+ firstDataType;
+
+ // Auto (xml, json, script or text determined given headers)
+ if ( transportDataType === "*" ) {
+
+ // Remove all auto types
+ while( dataTypes[0] === "*" ) {
+ dataTypes.shift();
+ }
+ transportDataTypes = dataTypes[0];
+
+ // Get content type
+ ct = jXHR.getResponseHeader( "content-type" );
+
+ // Check if it's a known type
+ for ( type in contents ) {
+ if ( contents[ type ] && contents[ type ].test( ct ) ) {
+ dataTypes.unshift( ( transportDataType = type ) );
+ break;
+ }
+ }
+ }
+
+ // Check to see if we have a response for the expected dataType
+ if ( transportDataType in responses ) {
+ finalDataType = transportDataType;
+ } else {
+ // Try convertible dataTypes
+ for ( type in responses ) {
+ if ( ! firstDataType ) {
+ firstDataType = type;
+ }
+ if ( ! transportDataType || converters[ type + " " + transportDataType ] ) {
+ finalDataType = type;
+ break;
+ }
+ }
+ // Or just use first one
+ finalDataType = finalDataType || firstDataType;
+ }
+
+ // If we found a dataType
+ // We get the corresponding response
+ // and add the dataType to the list if needed
+ if ( finalDataType ) {
+ response = responses[ finalDataType ];
+ if ( finalDataType !== transportDataType ) {
+ dataTypes.unshift( finalDataType );
+ }
+ }
+
+ // Fill responseXXX fields
+ for( type in responseFields ) {
+ if ( type in responses ) {
+ jXHR[ responseFields[ type ] ] = responses[ type ];
+ }
+ }
+ }