Added a fix for relative // - $("//div",this) (bug #1418)
[jquery.git] / src / selector / selector.js
index a78cb31..2cf0b64 100644 (file)
@@ -99,7 +99,7 @@ jQuery.extend({
 
                // Handle the common XPath // expression
                if ( !t.indexOf("//") ) {
-                       context = context.documentElement;
+                       //context = context.documentElement;
                        t = t.substr(2,t.length);
 
                // And the / root expression
@@ -142,7 +142,7 @@ jQuery.extend({
                                if ( t.indexOf(" ") == 0 ) continue;
                                foundToken = true;
                        } else {
-                               re = /^((\/?\.\.)|([>\/+~]))\s*([a-z]*)/i;
+                               re = /^((\/?\.\.)|([>\/+~]))\s*(\w*)/i;
 
                                if ( (m = re.exec(t)) != null ) {
                                        r = [];