X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fjquery%2Fjquery.js;h=ddb08a4381f980e417d8ca22552b92ff97b41d09;hb=9c94ef4c411867d38f301ccbf406af21e277188c;hp=a8872dfb8e17236f951e6f318809a246beb92f47;hpb=ec2b688920cf38f5bb2487b8a1897f7eb7557248;p=jquery.git diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js index a8872df..ddb08a4 100644 --- a/src/jquery/jquery.js +++ b/src/jquery/jquery.js @@ -1345,10 +1345,7 @@ jQuery.extend({ // internal only, use is(".class") has: function( t, c ) { - t = t.className || t; - // escape regex characters - c = c.replace(/([\.\\\+\*\?\[\^\]\$\(\)\{\}\=\!\<\>\|\:])/g, "\\$1"); - return t && new RegExp("(^|\\s)" + c + "(\\s|$)").test( t ); + return jQuery.inArray( c, (t.className || t).toString().split(/\s+/) ) > -1; } }, @@ -1629,9 +1626,10 @@ jQuery.extend({ * @cat JavaScript */ merge: function(first, second) { - for ( var i = 0, sl = second.length; i < sl; i++ ) + // We have to loop this way because IE & Opera overwrite the length + // expando of getElementsByTagName + for ( var i = 0; second[i]; i++ ) first.push(second[i]); - return first; },