W3C home > Mailing lists > Public > whatwg@whatwg.org > October 2009

[whatwg] document.head

From: Alex Russell <slightlyoff@google.com>
Date: Wed, 7 Oct 2009 18:46:39 -0700
Message-ID: <6fc58d0d0910071846x3aa52d22id3a50237e418f653@mail.gmail.com>
On Sun, Sep 20, 2009 at 2:26 PM, Juriy Zaytsev <kangax.dev at gmail.com> wrote:
>
> On Sep 20, 2009, at 5:20 PM, Joseph Pecoraro wrote:
>
>> On Sep 20, 2009, at 4: 24PM, Juriy Zaytsev wrote:
>>>
>>> Speaking of `document.head`, I think Mootools does exactly that.
>>
>>
>> Good thinking. ?I took a look at some JavaScript Libraries / Frameworks.
>> ?Here are some quick counts of how many times I could see that they use the
>> "getElementsByTagName" method of getting the "head" element:
>>
>> ?- MooTools 1.2.3 has: 2
>> ?- jQuery 1.3.2 has: 2
>> ?- Ext 3.0.0 has: 5
>> ?- YUI 3.0.0b1 has: >10
>> ?- Prototype 1.6.1, MochiKit 1.4.2, Dojo 1.3.2 have: 0
>
> There are none in Prototype.js simply because it is a rather small and low
> level library (I'm one of its core developers, btw). Libraries that use,
> say, "global eval" abstraction and/or dependency management (for scripts and
> styles) such as YUI obviously use HEAD more often (which your numbers
> confirm).

Similarly, the only reason that there aren't any in Dojo base is that
by the time you need to do that, you can just
dojo.query("head").at(0)...

Regards
Received on Wednesday, 7 October 2009 18:46:39 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:17 UTC