aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Resig <jeresig@gmail.com>2010-08-27 15:14:30 -0400
committerJohn Resig <jeresig@gmail.com>2010-08-27 15:14:30 -0400
commit1ead20c2ed7cb4fd647d632ff9de8104669482de (patch)
tree0126af5eca7e38b3b7cde18a930a0369c5c220f0
parent43fbe3b33aeaa73c151ddb59632c85bc7f8a87b9 (diff)
downloadjquery-1ead20c2ed7cb4fd647d632ff9de8104669482de.tar.gz
jquery-1ead20c2ed7cb4fd647d632ff9de8104669482de.zip
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.
-rw-r--r--src/core.js4
1 files changed, 3 insertions, 1 deletions
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] ) {