Re: JavaScript / CSS Wizards Please Help

"David Woolley"
> > 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.

If you look at GetRef in the clj FAQ http://jibbering.com/faq/#FAQ4_15
you'll see my approach (the expando property on the document isn't
necessary standard so I'd consider not doing that, I could have a browser
which doesn't support it for example, I also don't agree with the
sensibleness of duplicating gEBI in old browsers, they differ in too many
and unknown ways (and the amount that spoof/paritially implement things
like document.all make it more complicated.)  I think it's safer to think
in DOM1 or 2 terms and give everyone else fallback it's a lot safer.  "Dr
Clue" a poster in comp.lang.javascript and a talented scripter has a very
good "library" system that you're suggesting but it's far from a quality I
could suggest being reasonable from an accessibility P.O.V.


> 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.

Detect the break aswell if possible, as you'll never know when it was
fixed...

Jim.

Received on Wednesday, 5 December 2001 18:55:52 UTC