public/javascripts/yui/datasource/datasource-debug.js
function(oResponse) {
        // If response ID does not match last made request ID,
        // silently fail and wait for the next response
        if(oResponse && (this.connXhrMode == "ignoreStaleResponses") &&
                (oResponse.tId != oQueue.conn.tId)) {
            YAHOO.log("Ignored stale response", "warn", this.toString());
            return null;
        }
        // Error if no response
        else if(!oResponse) {
            this.fireEvent("dataErrorEvent", {request:oRequest, response:null,
                    callback:oCallback, caller:oCaller,
                    message:DS.ERROR_DATANULL});
            YAHOO.log(DS.ERROR_DATANULL, "error", this.toString());

            // Send error response back to the caller with the error flag on
            DS.issueCallback(oCallback,[oRequest, {error:true}], true, oCaller);

            return null;
        }
        // Forward to handler
        else {
            // Try to sniff data type if it has not been defined
            if(this.responseType === DS.TYPE_UNKNOWN) {
                var ctype = (oResponse.getResponseHeader) ? oResponse.getResponseHeader["Content-Type"] : null;
                if(ctype) {
                    // xml
                    if(ctype.indexOf("text/xml") > -1) {
                        this.responseType = DS.TYPE_XML;
                    }
                    else if(ctype.indexOf("application/json") > -1) { // json
                        this.responseType = DS.TYPE_JSON;
                    }
                    else if(ctype.indexOf("text/plain") > -1) { // text
                        this.responseType = DS.TYPE_TEXT;
                    }
                }
            }
            this.handleResponse(oRequest, oResponse, oCallback, oCaller, tId);
        }
    }
function(oResponse) {
        // If response ID does not match last made request ID,
        // silently fail and wait for the next response
        if(oResponse && (this.connXhrMode == "ignoreStaleResponses") &&
                (oResponse.tId != oQueue.conn.tId)) {
            YAHOO.log("Ignored stale response", "warn", this.toString());
            return null;
        }
        // Error if no response
        else if(!oResponse) {
            this.fireEvent("dataErrorEvent", {request:oRequest, response:null,
                    callback:oCallback, caller:oCaller,
                    message:DS.ERROR_DATANULL});
            YAHOO.log(DS.ERROR_DATANULL, "error", this.toString());

            // Send error response back to the caller with the error flag on
            DS.issueCallback(oCallback,[oRequest, {error:true}], true, oCaller);

            return null;
        }
        // Forward to handler
        else {
            // Try to sniff data type if it has not been defined
            if(this.responseType === DS.TYPE_UNKNOWN) {
                var ctype = (oResponse.getResponseHeader) ? oResponse.getResponseHeader["Content-Type"] : null;
                if(ctype) {
                    // xml
                    if(ctype.indexOf("text/xml") > -1) {
                        this.responseType = DS.TYPE_XML;
                    }
                    else if(ctype.indexOf("application/json") > -1) { // json
                        this.responseType = DS.TYPE_JSON;
                    }
                    else if(ctype.indexOf("text/plain") > -1) { // text
                        this.responseType = DS.TYPE_TEXT;
                    }
                }
            }
            this.handleResponse(oRequest, oResponse, oCallback, oCaller, tId);
        }
    }
function ( oResponse ) { // If response ID does not match last made request ID, // silently fail and wait for the next response if ( oResponse && ( this . connXhrMode == "ignoreStaleResponses" ) && ( oResponse . tId != oQueue . conn . tId ) ) { YAHOO . log ( "Ignored stale response" , "warn" , this . toString ( ) ) ; return null ; } // Error if no response else if ( ! oResponse ) { this . fireEvent ( "dataErrorEvent" , { request : oRequest , response : null , callback : oCallback , caller : oCaller , message : DS . ERROR_DATANULL } ) ; YAHOO . log ( DS . ERROR_DATANULL , "error" , this . toString ( ) ) ; // Send error response back to the caller with the error flag on DS . issueCallback ( oCallback , [ oRequest , { error : true } ] , true , oCaller ) ; return null ; } // Forward to handler else { // Try to sniff data type if it has not been defined if ( this . responseType === DS . TYPE_UNKNOWN ) { var ctype = ( oResponse . getResponseHeader ) ? oResponse . getResponseHeader [ "Content-Type" ] : null ; if ( ctype ) { // xml if ( ctype . indexOf ( "text/xml" ) > - 1 ) { this . responseType = DS . TYPE_XML ; } else if ( ctype . indexOf ( "application/json" ) > - 1 ) { // json this . responseType = DS . TYPE_JSON ; } else if ( ctype . indexOf ( "text/plain" ) > - 1 ) { // text this . responseType = DS . TYPE_TEXT ; } } } this . handleResponse ( oRequest , oResponse , oCallback , oCaller , tId ) ; } }
Define Connection Manager success handler

@method _xhrSuccess
@param oResponse {Object} HTTPXMLRequest object
@private
Define Connection Manager success handler