很奇怪?為什么能這樣?不是判斷document對象是否 reADy然后才執(zhí)行函數的么?document哪去了?我們看下jQuery的源代碼: 代碼如下: // jQuery的構造函數; var jQuery = function( a, c ) { // $(document).ready()的簡寫形式,只有在$(function(){...})下才會執(zhí)行; if ( a && typeof a == "function" && jQuery.fn.ready ) return jQuery(document).ready(a); // 確保參數a非空,默認值為document; a = a || jQuery.context || document;