3
var
// Will speed up references to window, and allows munging its name.
window = this,
// Will speed up references to undefined, and allows munging its name.
undefined,
// Map over jQuery in case of overwrite
_jQuery = window.jQuery,
// Map over the $ in case of overwrite
_$ = window.$,
jQuery = window.jQuery = window.$ = function(selector, context) {
// The jQuery object is actually just the init constructor 'enhanced'
return new jQuery.fn.init(selector, context);
};
爲什麼jQuery需要「_ $ = window. $」或「_jQuery = window.jQuery」?這對我來說沒有意義,但是如果沒有這兩行,框架就不起作用。
感謝您的幫助..
我沒有看到這個問題的相關性。你爲什麼需要知道?窗口。$ IS $,所以你可以在全球範圍內使用它..我想。 – metrobalderas 2010-03-04 15:30:52