Re: Selectors API naming

On 12/19/06, Ian Hickson <ian@hixie.ch> wrote:
> > I'd rather a webdev not have to understand "oh, this API was done by the
> > DOM WG, so it uses this naming... this one was done by the WebAPI WG, so
> > it uses this other one..."
>
> Well, the most obvious method name would be "document.select()". It's
> clear what it does given the context, and fits in well with the similar
> existing functionality, "document.all". Would "select()" be ok with you?

I don't think that "document.select()" is clear at all. My first
though would be, it is a method to select everything on the web page.
I think "document.getElementsBySelector()" is much more clearer. Also,
it is much more consistent with "document.getElementsByTagName()" and
"document.getElementById()" for instance.

Regards,
Martijn

> Ian Hickson               U+1047E                )\._.,--....,'``.    fL
> http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
> Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
>
>


-- 
Martijn Wargers
Help Mozilla!
http://weblogs.mozillazine.org/qa/
http://www.mozilla.org/contribute/

Received on Tuesday, 19 December 2006 15:02:12 UTC