W3C home > Mailing lists > Public > whatwg@whatwg.org > September 2005

[whatwg] getElementsByClassName()

From: Jim Ley <jim.ley@gmail.com>
Date: Mon, 5 Sep 2005 12:18:47 +0100
Message-ID: <851c8d310509050418e6663cc@mail.gmail.com>
On 9/5/05, Lachlan Hunt <lachlan.hunt at lachy.id.au> wrote:
> Jim Ley wrote:
> > className = className.match(/^\s*(\S+)\s*$/) ?
> > className.replace(/^\s*(\S+)\s*$/,"$1") : "";
> 
> That seems to work well.

Good, Good.

> > mainly because a DOM binding with optional parameters
> > isn't language independant, and if it's a ECMAScript tied DOM, then
> > the DOM needs to be a lot more ECMAScript like.
> 
> I may not be understanding what you mean, but if optional parameters
> aren't language independant, shouldn't it be defined in a more language
> independant way, so that any non-ECMAScript languages can still
> implement this?

Yes, DOM currently is language agnostic, however the optional
className parameters aren't compatible with languages which can't do
that.  So as defined now getElementsByClassName would not manage to do
that.

However there's a good argument for making an ECMAScript specific DOM,
as it would be more natural for the majority of ECMAScript programmers
who use it, but that would mean redefining most of the HTML DOM into
something neat in ES eyes.

Jim.
Received on Monday, 5 September 2005 04:18:47 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:42 UTC