W3C home > Mailing lists > Public > w3c-wai-ig@w3.org > October to December 2001

Re: JavaScript / CSS Wizards Please Help

From: David Woolley <david@djwhome.demon.co.uk>
Date: Wed, 5 Dec 2001 21:26:34 +0000 (GMT)
Message-Id: <200112052126.fB5LQYg07999@djwhome.demon.co.uk>
To: w3c-wai-ig@w3.org
> It should be:
> 
> // once per JS file
> var d=document;
> var DOM=(d.getElementById)?true:false;

I'd need to check some details, but I believe that you can define
functions dynamically,  by the use of strings, or possibly by 
copying a function between attributes.  If that is correct, I'd say
the best way of doing this would be to upgrade all the browsers to
DOM1 status by defining getElementById in those that don't already
support it.

In any case, I agree that the standards approach should be first,
not second, choice, but don't think talking in terms of particular
browsers is a good idea.  You should think in terms of testing 
for the presence of features, rather than particular browsers; this
code is feature testing, but labelling by browser, but a lot of
NS 6 failures are the result of user agent testing rather than feature
testing.

Only resort to thinking in terms of a browser when it behaves as 
though a feature is present when it is actually broken; but, better,
avoid such features.
Received on Wednesday, 5 December 2001 17:13:27 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 19 July 2011 18:13:58 GMT