Fixed #1039 and #1733 by going through the core API and making them text node and comment node safe.

This commit is contained in:
David Serduke 2007-12-07 01:52:21 +00:00
parent 12ef255ffd
commit ffbedf0262
8 changed files with 188 additions and 64 deletions

View file

@ -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;