(function( window, undefined ) {
// 構造jQuery對象
var jQuery = function( selector, context ) {
return new jQuery.fn.init( selector, context, rootjQuery );
}
// 工具函數 Utilities
// 異步隊列 Deferred
// 瀏覽器測試 Support
// 數據緩存 Data
// 隊列 queue
// 屬性操作 Attribute
// 事件處理 Event
// 選擇器 Sizzle
// DOM遍歷
// DOM操作
// CSS操作
// 異步請求 Ajax
// 動畫 FX
// 坐標和大小
window.jQuery = window.$ = jQuery;
})(window);
從上邊的注釋看,jQuery的源碼結構相當清晰、條理,不像代碼那般晦澀和讓人糾結。