X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fcore.js;h=3c7572fe6e3f158db25d1d1cfbaebe40195d5e57;hb=34bf1a2a7d688d9861350fd7836eb98268db821e;hp=2c2b7466622ab69cad829a27feecae4814d64147;hpb=6dfdb14753c66cfd38f8445bd6119ef4a1274d5e;p=jquery.git diff --git a/src/core.js b/src/core.js index 2c2b746..3c7572f 100644 --- a/src/core.js +++ b/src/core.js @@ -33,6 +33,9 @@ var jQuery = function( selector, context ) { // Check for non-word characters rnonword = /\W/, + // Check for digits + rdigit = /\d/, + // Match a standalone tag rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/, @@ -91,7 +94,7 @@ jQuery.fn = jQuery.prototype = { } // The body element only exists once, optimize finding it - if ( selector === "body" && !context ) { + if ( selector === "body" && !context && document.body ) { this.context = document; this[0] = document.body; this.selector = "body"; @@ -397,7 +400,7 @@ jQuery.extend({ if ( !jQuery.readyWait || (wait !== true && !jQuery.isReady) ) { // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). if ( !document.body ) { - return setTimeout( jQuery.ready, 13 ); + return setTimeout( jQuery.ready, 1 ); } // Remember that the DOM is ready @@ -438,7 +441,7 @@ jQuery.extend({ // browser event has already occurred. if ( document.readyState === "complete" ) { // Handle it asynchronously to allow scripts the opportunity to delay ready - return setTimeout( jQuery.ready, 13 ); + return setTimeout( jQuery.ready, 1 ); } // Mozilla, Opera and webkit nightlies currently support this event @@ -488,6 +491,10 @@ jQuery.extend({ return obj && typeof obj === "object" && "setInterval" in obj; }, + isNaN: function( obj ) { + return obj == null || !rdigit.test( obj ) || isNaN( obj ); + }, + type: function( obj ) { return obj == null ? String( obj ) : @@ -719,6 +726,7 @@ jQuery.extend({ } } + // Flatten any nested arrays return ret.concat.apply( [], ret ); },