From: John Resig Date: Fri, 7 Jul 2006 00:31:27 +0000 (+0000) Subject: Added document.ready shortcut to $(). X-Git-Url: http://git.asbjorn.it/?a=commitdiff_plain;ds=sidebyside;h=e2c2a9392e14f4190148b3c8014fdccf66785b88;p=jquery.git Added document.ready shortcut to $(). --- diff --git a/jquery/jquery.js b/jquery/jquery.js index 4ba40ff..dad8e6d 100644 --- a/jquery/jquery.js +++ b/jquery/jquery.js @@ -18,6 +18,10 @@ window.undefined = window.undefined; */ function jQuery(a,c) { + // Shortcut for document ready (because $(document).each() is silly) + if ( a && a.constructor == Function ) + return $(document).ready(a); + // Make sure t hat a selection was provided a = a || jQuery.context || document;