0
//Taken from jQl:
var jQl = {
    "q": [],
    "unq": function() {
        for (var i = 0; i < jQl.q.length; i++)
        jQl.q[i]();
        jQl.q = [];
    },
    "ready": function(f, t) {
        if (typeof f == 'function') {
            if (typeof t != undefined && t == true) {
                jQl.q.unshift(f);
            } else {
                jQl.q.push(f);
            }
        }
        // return jQl in order to support jQuery(document).ready()
        return jQl;
    },

    "bId": null,
    "boot": function(callback) {
        if (typeof window.jQuery == 'undefined' || typeof window.jQuery.fn == 'undefined') {
            if (!jQl.bId) {
                jQl.bId = setInterval(function() {
                    jQl.boot(callback)
                }, 25);
            }
            return;
        }
        if (jQl.bId) {
            clearInterval(jQl.bId);
        }
        jQl.bId = 0;
        // OK, jQuery is loaded,
        // we can load additional jQuery dependents modules
        //jQl.unqjQdep();
        // then unqueue all inline calls
        // (when document is ready)
        $(jQl.unq());

        // call the callback if provided
        if (typeof callback == 'function') callback();
    }
}​

jQuery Loader 是一个用于 jquery 和 jquery 插件的异步非阻塞加载器。Loader 的好处是可以同时加载 jQuery 和依赖的插件,而不影响页面上的渲染。

  1. jQl,jQuery loader,q代表queue,最初q是一个空数组[]unq代表unqueue,它循环通过 jQuery 队列和出队来下载。

  2. 当它准备好时,如果f是一个函数,jQuery queue unshifts. 不知道有什么unshift作用?pushjQuery Loader 队列相对。

  3. 我不是很清楚bID吗?setInterval函数中。

4

1 回答 1

0

我不知道 unshift 是做什么的?

unshift是一种数组方法。例如:

[1,2,3,4].unshift()

返回 4

我对投标的事情不太清楚?

`bID` is the boot ID, a variable initially set to `null`, then set to `0` when jQuery loads
于 2015-06-26T14:23:58.447 回答