X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcore.js;h=3a9eaa7de7741a93b646a54ec9f79a8bf433e427;hb=136a459f4c24880f6d07f26c07e56451385637e0;hp=ebad0c1b68215b521c972a0c4a58262d53b0c576;hpb=ce90accc58d213fcf567ab2ca464ee9164601dc4;p=jquery.git diff --git a/src/core.js b/src/core.js index ebad0c1..3a9eaa7 100644 --- a/src/core.js +++ b/src/core.js @@ -627,9 +627,7 @@ jQuery.extend({ // Evalulates a script in a global context globalEval: function( data ) { - data = jQuery.trim( data ); - - if ( data ) { + if ( data && /\S/.test(data) ) { // Inspired by code by Andrea Giammarchi // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html var head = document.getElementsByTagName("head")[0] || document.documentElement, @@ -857,7 +855,7 @@ jQuery.extend({ }); // Trim whitespace, otherwise indexOf won't work as expected - var tags = jQuery.trim( elem ).toLowerCase(); + var tags = elem.replace(/^\s+/, "").substring(0, 10).toLowerCase(); var wrap = // option or optgroup @@ -897,11 +895,12 @@ jQuery.extend({ if ( !jQuery.support.tbody ) { // String was a , *may* have spurious - var tbody = !tags.indexOf(" or - wrap[1] == "
" && tags.indexOf("" && !hasBody ? div.childNodes : [];