]> source.dussan.org Git - jquery.git/commitdiff
Blackberry 4.6 is capable of finding elements that are no longer in the DOM via getEl...
authorJohn Resig <jeresig@gmail.com>
Fri, 27 Aug 2010 19:14:30 +0000 (15:14 -0400)
committerJohn Resig <jeresig@gmail.com>
Fri, 27 Aug 2010 19:14:30 +0000 (15:14 -0400)
src/core.js

index 6e1f74520d9c0fa8407e67b1d9ab16d1e6e7dd83..905a399311ba521679ed6d3dc7ebf90cdd3d829e 100644 (file)
@@ -119,7 +119,9 @@ jQuery.fn = jQuery.prototype = {
                                } else {
                                        elem = document.getElementById( match[2] );
 
-                                       if ( elem ) {
+                                       // Check parentNode to catch when Blackberry 4.6 returns
+                                       // nodes that are no longer in the document #6963
+                                       if ( elem && elem.parentNode ) {
                                                // Handle the case where IE and Opera return items
                                                // by name instead of ID
                                                if ( elem.id !== match[2] ) {