X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcore.js;h=23b96442e961a929e01fd6f69a1a7eeb46817406;hb=957cd6fb2a2b7b8cfe9ac6b3f2b3cc2bc8163449;hp=5f2cf20b909829f3bc18d4154f6aed4e30e7a944;hpb=18a6fbbb6ab0bdabbbd377d23385650e45c30e74;p=jquery.git diff --git a/src/core.js b/src/core.js index 5f2cf20..23b9644 100644 --- a/src/core.js +++ b/src/core.js @@ -39,15 +39,14 @@ var jQuery = function( selector, context ) { push = Array.prototype.push, slice = Array.prototype.slice; -// Expose jQuery to the global object -window.jQuery = window.$ = jQuery; - jQuery.fn = jQuery.prototype = { init: function( selector, context ) { var match, elem, ret; // Handle $(""), $(null), or $(undefined) - if ( !selector ) return this; + if ( !selector ) { + return this; + } // Handle $(DOMElement) if ( selector.nodeType ) { @@ -75,7 +74,9 @@ jQuery.fn = jQuery.prototype = { if ( elem ) { // Handle the case where IE and Opera return items // by name instead of ID - if ( elem.id !== match[2] ) return rootjQuery.find( selector ); + if ( elem.id !== match[2] ) { + return rootjQuery.find( selector ); + } // Otherwise, we inject the element directly into the jQuery object this.length++; @@ -315,7 +316,7 @@ jQuery.extend({ isXMLDoc: function( elem ) { // documentElement is verified for cases where it doesn't yet exist // (such as loading iframes in IE - #4833) - return ((elem.ownerDocument || elem).documentElement || 0).nodeName !== "HTML"; + return ((elem ? elem.ownerDocument || elem : 0).documentElement || 0).nodeName !== "HTML"; }, // Evalulates a script in a global context