diff options
author | David Serduke <davidserduke@gmail.com> | 2007-12-07 01:52:21 +0000 |
---|---|---|
committer | David Serduke <davidserduke@gmail.com> | 2007-12-07 01:52:21 +0000 |
commit | ffbedf0262b3eea906f39c0115b818d7456a3994 (patch) | |
tree | 69dc757c4b0eaa921ab58b8d35271a5ca2d26e90 /src/selector.js | |
parent | 12ef255ffdb3c2d045ee37beb9419f14d9c30217 (diff) | |
download | jquery-ffbedf0262b3eea906f39c0115b818d7456a3994.tar.gz jquery-ffbedf0262b3eea906f39c0115b818d7456a3994.zip |
Fixed #1039 and #1733 by going through the core API and making them text node and comment node safe.
Diffstat (limited to 'src/selector.js')
-rw-r--r-- | src/selector.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/selector.js b/src/selector.js index da2724530..c35fbb1eb 100644 --- a/src/selector.js +++ b/src/selector.js @@ -96,9 +96,9 @@ jQuery.extend({ if ( typeof t != "string" ) return [ t ]; - // Make sure that the context is a DOM Element - if ( context && !context.nodeType ) - context = null; + // check to make sure context is a DOM element or a document + if ( context && context.nodeType != 1 && context.nodeType != 9) + return [ ]; // Set the correct context (if none is provided) context = context || document; |