Actually, the correct behavior would be to return an empty set, it would seem, since that DocumentFragment is purely incidental.
Filed: http://dev.jquery.com/ticket/5638 Fixed: http://github.com/jquery/jquery/commit/65ebf57c1e5d7fa96536b66d4fcacbafad8dc1e5 --John On Thu, Dec 10, 2009 at 4:40 PM, ajpiano <ajpi...@gmail.com> wrote: > Not sure if this merits a ticket because it ventures off into the > world of "things that people don't actually do," but I figured it was > at least worth a mention. > > in jQuery 1.3.2 > var foo = $("<div><span>foo</span></div>").parent() // returns a DIV > wrapped with jQuery, and accordingly > foo.find("span").length === 1; > > in jQuery 1.4 > var foo = $("<div><span>foo</span></div>").parent() // returns a > DocumentFragment wrapped with jQuery, and accordingly > foo.find("span").length === 0; > > I'm not sure if this piques anyone else's attention like it did mine. > Getting to behave the same would require getting .find() to work > directly on DocumentFragments instead of their .contents(), which I am > less than sure is a priority. > > --adam > > -- > > You received this message because you are subscribed to the Google Groups > "jQuery Development" group. > To post to this group, send email to jquery-...@googlegroups.com. > To unsubscribe from this group, send email to > jquery-dev+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/jquery-dev?hl=en. > > > -- You received this message because you are subscribed to the Google Groups "jQuery Development" group. To post to this group, send email to jquery-...@googlegroups.com. To unsubscribe from this group, send email to jquery-dev+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en.