$.noConflict();

It reverts $ to what it was before jQuery was loaded.

$.noConflict()函数将返回在jQuery加载之前$所存的值

当我们导入jQuery时,jQuery仅向window这个全局空间注入两个变量:


window.$ = window.jQuery = { jQuery object };

// Map over the $ in case of overwrite
_$ = window.$ //之前上面的$存的值
_jQuery = window.jQuery //之前上面的jQuery 存的值
//....
noConflict: function( deep ) {
            window.$ = _$; //window.$变成之前存的值

            if ( deep ) {
                window.jQuery = _jQuery;
            }

            return jQuery;
        }