public/javascripts/yui/yuiloader/yuiloader.js
function(id, loaded) {
        var q = queues[id];

        if (q.timer) {
            // Y.log('cancel timer');
            q.timer.cancel();
        }

        if (q.aborted) {
            var msg = "transaction " + id + " was aborted";
            _fail(id, msg);
            return;
        }

        if (loaded) {
            q.url.shift(); 
            if (q.varName) {
                q.varName.shift(); 
            }
        } else {
            // This is the first pass: make sure the url is an array
            q.url = (lang.isString(q.url)) ? [q.url] : q.url;
            if (q.varName) {
                q.varName = (lang.isString(q.varName)) ? [q.varName] : q.varName;
            }
        }

        var w=q.win, d=w.document, h=d.getElementsByTagName("head")[0], n;

        if (q.url.length === 0) {
            // Safari 2.x workaround - There is no way to know when 
            // a script is ready in versions of Safari prior to 3.x.
            // Adding an extra node reduces the problem, but doesn't
            // eliminate it completely because the browser executes
            // them asynchronously. 
            if (q.type === "script" && ua.webkit && ua.webkit < 420 && 
                    !q.finalpass && !q.varName) {
                // Add another script node.  This does not guarantee that the
                // scripts will execute in order, but it does appear to fix the
                // problem on fast connections more effectively than using an
                // arbitrary timeout.  It is possible that the browser does
                // block subsequent script execution in this case for a limited
                // time.
                var extra = _scriptNode(null, q.win, q.attributes);
                extra.innerHTML='YAHOO.util.Get._finalize("' + id + '");';
                q.nodes.push(extra); h.appendChild(extra);

            } else {
                _finish(id);
            }

            return;
        } 


        var url = q.url[0];

        // if the url is undefined, this is probably a trailing comma problem in IE
        if (!url) {
            q.url.shift(); 
            return _next(id);
        }


        if (q.timeout) {
            // Y.log('create timer');
            q.timer = lang.later(q.timeout, q, _timeout, id);
        }

        if (q.type === "script") {
            n = _scriptNode(url, w, q.attributes);
        } else {
            n = _linkNode(url, w, q.attributes);
        }

        // track this node's load progress
        _track(q.type, n, id, url, w, q.url.length);

        // add the node to the queue so we can return it to the user supplied callback
        q.nodes.push(n);

        // add it to the head or insert it before 'insertBefore'
        if (q.insertBefore) {
            var s = _get(q.insertBefore, id);
            if (s) {
                s.parentNode.insertBefore(n, s);
            }
        } else {
            h.appendChild(n);
        }
        

        // FireFox does not support the onload event for link nodes, so there is
        // no way to make the css requests synchronous. This means that the css 
        // rules in multiple files could be applied out of order in this browser
        // if a later request returns before an earlier one.  Safari too.
        if ((ua.webkit || ua.gecko) && q.type === "css") {
            _next(id, url);
        }
    }
function(id, loaded) {
        var q = queues[id];

        if (q.timer) {
            // Y.log('cancel timer');
            q.timer.cancel();
        }

        if (q.aborted) {
            var msg = "transaction " + id + " was aborted";
            _fail(id, msg);
            return;
        }

        if (loaded) {
            q.url.shift(); 
            if (q.varName) {
                q.varName.shift(); 
            }
        } else {
            // This is the first pass: make sure the url is an array
            q.url = (lang.isString(q.url)) ? [q.url] : q.url;
            if (q.varName) {
                q.varName = (lang.isString(q.varName)) ? [q.varName] : q.varName;
            }
        }

        var w=q.win, d=w.document, h=d.getElementsByTagName("head")[0], n;

        if (q.url.length === 0) {
            // Safari 2.x workaround - There is no way to know when 
            // a script is ready in versions of Safari prior to 3.x.
            // Adding an extra node reduces the problem, but doesn't
            // eliminate it completely because the browser executes
            // them asynchronously. 
            if (q.type === "script" && ua.webkit && ua.webkit < 420 && 
                    !q.finalpass && !q.varName) {
                // Add another script node.  This does not guarantee that the
                // scripts will execute in order, but it does appear to fix the
                // problem on fast connections more effectively than using an
                // arbitrary timeout.  It is possible that the browser does
                // block subsequent script execution in this case for a limited
                // time.
                var extra = _scriptNode(null, q.win, q.attributes);
                extra.innerHTML='YAHOO.util.Get._finalize("' + id + '");';
                q.nodes.push(extra); h.appendChild(extra);

            } else {
                _finish(id);
            }

            return;
        } 


        var url = q.url[0];

        // if the url is undefined, this is probably a trailing comma problem in IE
        if (!url) {
            q.url.shift(); 
            return _next(id);
        }


        if (q.timeout) {
            // Y.log('create timer');
            q.timer = lang.later(q.timeout, q, _timeout, id);
        }

        if (q.type === "script") {
            n = _scriptNode(url, w, q.attributes);
        } else {
            n = _linkNode(url, w, q.attributes);
        }

        // track this node's load progress
        _track(q.type, n, id, url, w, q.url.length);

        // add the node to the queue so we can return it to the user supplied callback
        q.nodes.push(n);

        // add it to the head or insert it before 'insertBefore'
        if (q.insertBefore) {
            var s = _get(q.insertBefore, id);
            if (s) {
                s.parentNode.insertBefore(n, s);
            }
        } else {
            h.appendChild(n);
        }
        

        // FireFox does not support the onload event for link nodes, so there is
        // no way to make the css requests synchronous. This means that the css 
        // rules in multiple files could be applied out of order in this browser
        // if a later request returns before an earlier one.  Safari too.
        if ((ua.webkit || ua.gecko) && q.type === "css") {
            _next(id, url);
        }
    }
function ( id , loaded ) { var q = queues [ id ] ; if ( q . timer ) { // Y.log('cancel timer'); q . timer . cancel ( ) ; } if ( q . aborted ) { var msg = "transaction " + id + " was aborted" ; _fail ( id , msg ) ; return ; } if ( loaded ) { q . url . shift ( ) ; if ( q . varName ) { q . varName . shift ( ) ; } } else { // This is the first pass: make sure the url is an array q . url = ( lang . isString ( q . url ) ) ? [ q . url ] : q . url ; if ( q . varName ) { q . varName = ( lang . isString ( q . varName ) ) ? [ q . varName ] : q . varName ; } } var w = q . win , d = w . document , h = d . getElementsByTagName ( "head" ) [ 0 ] , n ; if ( q . url . length === 0 ) { // Safari 2.x workaround - There is no way to know when  // a script is ready in versions of Safari prior to 3.x. // Adding an extra node reduces the problem, but doesn't // eliminate it completely because the browser executes // them asynchronously.  if ( q . type === "script" && ua . webkit && ua . webkit < 420 && ! q . finalpass && ! q . varName ) { // Add another script node.  This does not guarantee that the // scripts will execute in order, but it does appear to fix the // problem on fast connections more effectively than using an // arbitrary timeout.  It is possible that the browser does // block subsequent script execution in this case for a limited // time. var extra = _scriptNode ( null , q . win , q . attributes ) ; extra . innerHTML = 'YAHOO.util.Get._finalize("' + id + '");' ; q . nodes . push ( extra ) ; h . appendChild ( extra ) ; } else { _finish ( id ) ; } return ; } var url = q . url [ 0 ] ; // if the url is undefined, this is probably a trailing comma problem in IE if ( ! url ) { q . url . shift ( ) ; return _next ( id ) ; } if ( q . timeout ) { // Y.log('create timer'); q . timer = lang . later ( q . timeout , q , _timeout , id ) ; } if ( q . type === "script" ) { n = _scriptNode ( url , w , q . attributes ) ; } else { n = _linkNode ( url , w , q . attributes ) ; } // track this node's load progress _track ( q . type , n , id , url , w , q . url . length ) ; // add the node to the queue so we can return it to the user supplied callback q . nodes . push ( n ) ; // add it to the head or insert it before 'insertBefore' if ( q . insertBefore ) { var s = _get ( q . insertBefore , id ) ; if ( s ) { s . parentNode . insertBefore ( n , s ) ; } } else { h . appendChild ( n ) ; } // FireFox does not support the onload event for link nodes, so there is // no way to make the css requests synchronous. This means that the css  // rules in multiple files could be applied out of order in this browser // if a later request returns before an earlier one.  Safari too. if ( ( ua . webkit || ua . gecko ) && q . type === "css" ) { _next ( id , url ) ; } }
Loads the next item for a given request
@method _next
@param id {string} the id of the request
@param loaded {string} the url that was just loaded, if any
@private
Loads the next item for a given request