X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fcore.js;h=5f2cf20b909829f3bc18d4154f6aed4e30e7a944;hb=18a6fbbb6ab0bdabbbd377d23385650e45c30e74;hp=7e7a4e2e977f4fb10aaa0c2613d2ecdd1df9620d;hpb=8c18dcdeb08b8e2b908c17efd760ff25635f3749;p=jquery.git diff --git a/src/core.js b/src/core.js index 7e7a4e2..5f2cf20 100644 --- a/src/core.js +++ b/src/core.js @@ -20,7 +20,7 @@ var jQuery = function( selector, context ) { // A simple way to check for HTML strings or ID strings // (both of which we optimize for) - quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/, + quickExpr = /^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/, // Is it a simple selector isSimple = /^.[^:#\[\.,]*$/, @@ -70,12 +70,12 @@ jQuery.fn = jQuery.prototype = { // HANDLE: $("#id") } else { - elem = document.getElementById( match[3] ); + elem = document.getElementById( match[2] ); if ( elem ) { // Handle the case where IE and Opera return items // by name instead of ID - if ( elem.id !== match[3] ) 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++;