public/javascripts/yui/yuiloader/yuiloader.js
function(type, n, id, url, win, qlength, trackfn) {
        var f = trackfn || _next;

        // IE supports the readystatechange event for script and css nodes
        if (ua.ie) {
            n.onreadystatechange = function() {
                var rs = this.readyState;
                if ("loaded" === rs || "complete" === rs) {
                    n.onreadystatechange = null;
                    f(id, url);
                }
            };

        // webkit prior to 3.x is problemmatic
        } else if (ua.webkit) {

            if (type === "script") {

                // Safari 3.x supports the load event for script nodes (DOM2)
                if (ua.webkit >= 420) {

                    n.addEventListener("load", function() {
                        f(id, url);
                    });

                // Nothing can be done with Safari < 3.x except to pause and hope
                // for the best, particularly after last script is inserted. The
                // scripts will always execute in the order they arrive, not
                // necessarily the order in which they were inserted.  To support
                // script nodes with complete reliability in these browsers, script
                // nodes either need to invoke a function in the window once they
                // are loaded or the implementer needs to provide a well-known
                // property that the utility can poll for.
                } else {
                    // Poll for the existence of the named variable, if it
                    // was supplied.
                    var q = queues[id];
                    if (q.varName) {
                        var freq=YAHOO.util.Get.POLL_FREQ;
                        q.maxattempts = YAHOO.util.Get.TIMEOUT/freq;
                        q.attempts = 0;
                        q._cache = q.varName[0].split(".");
                        q.timer = lang.later(freq, q, function(o) {
                            var a=this._cache, l=a.length, w=this.win, i;
                            for (i=0; i<l; i=i+1) {
                                w = w[a[i]];
                                if (!w) {
                                    // if we have exausted our attempts, give up
                                    this.attempts++;
                                    if (this.attempts++ > this.maxattempts) {
                                        var msg = "Over retry limit, giving up";
                                        q.timer.cancel();
                                        _fail(id, msg);
                                    } else {
                                    }
                                    return;
                                }
                            }
                            

                            q.timer.cancel();
                            f(id, url);

                        }, null, true);
                    } else {
                        lang.later(YAHOO.util.Get.POLL_FREQ, null, f, [id, url]);
                    }
                }
            } 

        // FireFox and Opera support onload (but not DOM2 in FF) handlers for
        // script nodes.  Opera, but not FF, supports the onload event for link
        // nodes.
        } else { 
            n.onload = function() {
                f(id, url);
            };
        }
    }
function(type, n, id, url, win, qlength, trackfn) {
        var f = trackfn || _next;

        // IE supports the readystatechange event for script and css nodes
        if (ua.ie) {
            n.onreadystatechange = function() {
                var rs = this.readyState;
                if ("loaded" === rs || "complete" === rs) {
                    n.onreadystatechange = null;
                    f(id, url);
                }
            };

        // webkit prior to 3.x is problemmatic
        } else if (ua.webkit) {

            if (type === "script") {

                // Safari 3.x supports the load event for script nodes (DOM2)
                if (ua.webkit >= 420) {

                    n.addEventListener("load", function() {
                        f(id, url);
                    });

                // Nothing can be done with Safari < 3.x except to pause and hope
                // for the best, particularly after last script is inserted. The
                // scripts will always execute in the order they arrive, not
                // necessarily the order in which they were inserted.  To support
                // script nodes with complete reliability in these browsers, script
                // nodes either need to invoke a function in the window once they
                // are loaded or the implementer needs to provide a well-known
                // property that the utility can poll for.
                } else {
                    // Poll for the existence of the named variable, if it
                    // was supplied.
                    var q = queues[id];
                    if (q.varName) {
                        var freq=YAHOO.util.Get.POLL_FREQ;
                        q.maxattempts = YAHOO.util.Get.TIMEOUT/freq;
                        q.attempts = 0;
                        q._cache = q.varName[0].split(".");
                        q.timer = lang.later(freq, q, function(o) {
                            var a=this._cache, l=a.length, w=this.win, i;
                            for (i=0; i<l; i=i+1) {
                                w = w[a[i]];
                                if (!w) {
                                    // if we have exausted our attempts, give up
                                    this.attempts++;
                                    if (this.attempts++ > this.maxattempts) {
                                        var msg = "Over retry limit, giving up";
                                        q.timer.cancel();
                                        _fail(id, msg);
                                    } else {
                                    }
                                    return;
                                }
                            }
                            

                            q.timer.cancel();
                            f(id, url);

                        }, null, true);
                    } else {
                        lang.later(YAHOO.util.Get.POLL_FREQ, null, f, [id, url]);
                    }
                }
            } 

        // FireFox and Opera support onload (but not DOM2 in FF) handlers for
        // script nodes.  Opera, but not FF, supports the onload event for link
        // nodes.
        } else { 
            n.onload = function() {
                f(id, url);
            };
        }
    }
function ( type , n , id , url , win , qlength , trackfn ) { var f = trackfn || _next ; // IE supports the readystatechange event for script and css nodes if ( ua . ie ) { n . onreadystatechange = function ( ) { var rs = this . readyState ; if ( "loaded" === rs || "complete" === rs ) { n . onreadystatechange = null ; f ( id , url ) ; } } ; // webkit prior to 3.x is problemmatic } else if ( ua . webkit ) { if ( type === "script" ) { // Safari 3.x supports the load event for script nodes (DOM2) if ( ua . webkit >= 420 ) { n . addEventListener ( "load" , function ( ) { f ( id , url ) ; } ) ; // Nothing can be done with Safari < 3.x except to pause and hope // for the best, particularly after last script is inserted. The // scripts will always execute in the order they arrive, not // necessarily the order in which they were inserted.  To support // script nodes with complete reliability in these browsers, script // nodes either need to invoke a function in the window once they // are loaded or the implementer needs to provide a well-known // property that the utility can poll for. } else { // Poll for the existence of the named variable, if it // was supplied. var q = queues [ id ] ; if ( q . varName ) { var freq = YAHOO . util . Get . POLL_FREQ ; q . maxattempts = YAHOO . util . Get . TIMEOUT / freq ; q . attempts = 0 ; q . _cache = q . varName [ 0 ] . split ( "." ) ; q . timer = lang . later ( freq , q , function ( o ) { var a = this . _cache , l = a . length , w = this . win , i ; for ( i = 0 ; i < l ; i = i + 1 ) { w = w [ a [ i ] ] ; if ( ! w ) { // if we have exausted our attempts, give up this . attempts ++ ; if ( this . attempts ++ > this . maxattempts ) { var msg = "Over retry limit, giving up" ; q . timer . cancel ( ) ; _fail ( id , msg ) ; } else { } return ; } } q . timer . cancel ( ) ; f ( id , url ) ; } , null , true ) ; } else { lang . later ( YAHOO . util . Get . POLL_FREQ , null , f , [ id , url ] ) ; } } } // FireFox and Opera support onload (but not DOM2 in FF) handlers for // script nodes.  Opera, but not FF, supports the onload event for link // nodes. } else { n . onload = function ( ) { f ( id , url ) ; } ; } }
Detects when a node has been loaded.  In the case of
script nodes, this does not guarantee that contained
script is ready to use.
@method _track
@param type {string} the type of node to track
@param n {HTMLElement} the node to track
@param id {string} the id of the request
@param url {string} the url that is being loaded
@param win {Window} the targeted window
@param qlength the number of remaining items in the queue,
including this one
@param trackfn {Function} function to execute when finished
the default is _next
@private
Detects when a node has been loaded . In the case of script nodes this does not guarantee that contained script is ready to use .