]> source.dussan.org Git - jquery.git/commitdiff
Added document.ready shortcut to $().
authorJohn Resig <jeresig@gmail.com>
Fri, 7 Jul 2006 00:31:27 +0000 (00:31 +0000)
committerJohn Resig <jeresig@gmail.com>
Fri, 7 Jul 2006 00:31:27 +0000 (00:31 +0000)
jquery/jquery.js

index 4ba40ff80c648dbc0d8713def70ff304c55f85c4..dad8e6d27c2da2f59b010b4944685630f0ddacdd 100644 (file)
@@ -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;