Fix jQuery constructor to handle DOM NodeLists properly in Safari
authorBrandon Aaron <brandon.aaron@gmail.com>
Thu, 2 Nov 2006 19:53:11 +0000 (19:53 +0000)
committerBrandon Aaron <brandon.aaron@gmail.com>
Thu, 2 Nov 2006 19:53:11 +0000 (19:53 +0000)
src/jquery/jquery.js

index 996ace8..bdbf97c 100644 (file)
@@ -31,7 +31,7 @@ window.undefined = window.undefined;
 var jQuery = function(a,c) {
 
        // Shortcut for document ready (because $(document).each() is silly)
-       if ( a && typeof a == "function" && jQuery.fn.ready )
+       if ( a && typeof a == "function" && jQuery.fn.ready && a.length == undefined ) // Safari reports DOM NodeLists typeof as function
                return jQuery(document).ready(a);
 
        // Make sure that a selection was provided