Fixed a bug in .dir() where it would return non-element nodes.
authorJohn Resig <jeresig@gmail.com>
Mon, 10 Sep 2007 00:00:30 +0000 (00:00 +0000)
committerJohn Resig <jeresig@gmail.com>
Mon, 10 Sep 2007 00:00:30 +0000 (00:00 +0000)
src/selector.js

index 1fbbe9b..f746fe1 100644 (file)
@@ -404,7 +404,8 @@ jQuery.extend({
                var matched = [];
                var cur = elem[dir];
                while ( cur && cur != document ) {
-                       matched.push( cur );
+                       if ( cur.nodeType == 1 )
+                               matched.push( cur );
                        cur = cur[dir];
                }
                return matched;