aboutsummaryrefslogtreecommitdiffstats
path: root/src/selector.js
diff options
context:
space:
mode:
authorDavid Serduke <davidserduke@gmail.com>2007-12-07 01:52:21 +0000
committerDavid Serduke <davidserduke@gmail.com>2007-12-07 01:52:21 +0000
commitffbedf0262b3eea906f39c0115b818d7456a3994 (patch)
tree69dc757c4b0eaa921ab58b8d35271a5ca2d26e90 /src/selector.js
parent12ef255ffdb3c2d045ee37beb9419f14d9c30217 (diff)
downloadjquery-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.js6
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;