From: John Resig Date: Fri, 27 Aug 2010 19:14:30 +0000 (-0400) Subject: Blackberry 4.6 is capable of finding elements that are no longer in the DOM via getEl... X-Git-Tag: 1.4.3rc1~132 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1ead20c2ed7cb4fd647d632ff9de8104669482de;p=jquery.git Blackberry 4.6 is capable of finding elements that are no longer in the DOM via getElementById. It only appears to happen when the node has been inside of a cloned Document Fragment. Fixes #6963. --- diff --git a/src/core.js b/src/core.js index 6e1f74520..905a39931 100644 --- a/src/core.js +++ b/src/core.js @@ -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] ) {