Fix for passing jQuery constructor a DOM NodeList in Safari and an object or embed HTMLElement in Firefox.

This commit is contained in:
Brandon Aaron 2006-11-02 23:07:13 +00:00
parent d6d3316962
commit e9917ab837

View 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.nodeType && a[0] == undefined ) // Safari reports typeof on DOM NodeLists as a function
return jQuery(document).ready(a);
// Make sure that a selection was provided