> $()
> $("html")
> $( document )

All three of those things point to different things so it doesn't make
sense to have it be a "singleton".

The first gives you an empty set, the second is a set containing the
document element, the third is a set containing the document.

The only case we could (presumably) optimize for would be jQuery(
document ) but in attempting to do that a while back (back when
rootQuery was introduced) it proved to have a number of unforeseen
consequences (namely that users expect the results being returning
from jQuery to be unique).

As it is, we've made the one optimization that we can make (speeding
up jQuery("someselector") by not having to call jQuery(document) every
time) and I think that's fine.

--John

--

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.


Reply via email to