Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Norman L. DeForest
June 20, 2005, 3:12 pm
rate this thread
OK, there appear to be three major Document Object Models for
document.layers -- Netscape
document.all -- Micro$oft
document.GetElementById -- W3C (used by Firefox, etc.)
Trying to find information on the document.layers model, I continuously
get directed to one or another page:
which has stopped responding to http queries some time ago. (Lynx just
times out trying to connect.)
Micro$oft's site either has no downloadable references or they make them
very hard to find. Instead, it is necessary to navigate through a maze of
pages, one for each object, method, function, style, property, keyword or
and thousands and thousands of tiny little pages.
Micro$oft's implementations was a bit difficult but I eventually did find
it W3C's DOM in downloadable format and have used the information in that
I thought it would be nice to support *all* browsers but then have
learned from several sources that Netscape's new browser version
is selectable to emulate Firefox or IE. No mention is made of it
supporting the old Netscape standard. Then I found out in a newsgroup
for the handicapped that Internet Explorer version 6 now supports the
document.GetElementById model and that my puzzles work with IE 6.
That suggests that it may be pointless to bother learning anything but
the W3C DOM.
So, should I bother at all to try to learn the document.layers and
document.all methods of implementing DHTML or will the W3C DOM become
supported enough that the other models become superfluous?
Norman De Forest http://www.chebucto.ns.ca/~af380/Profile.html
email@example.com [=||=] (A Speech Friendly Site)
Q. Which is the greater problem in the world today, ignorance or apathy?
A. I don't know and I couldn't care less.
Norman L. DeForest wrote:
The Netscape referred to is NN4, not later versions. Don't bother
spending a lot of time catering to this ancient browser.
Modern versions of Internet Explorer also use document.getElementById.
It is quite easy to deal with older versions of Internet Explorer that
require use of document.all. I use this function to access objects via ID:
// getObject - get object associated with an ID, or null if no object
function getObject ( id )
if ( id == "" )
return( null );
if ( document.getElementById && (obj = document.getElementById(id)) )
else if ( document.all && (obj = document.all[id]) )
else /* DOM not supported, or no object */
return( null );
return( obj );
If you use such a function to get objects via ID, browser differences in
this regard become irrelevant.
No, use the W3C DOM, but use a good DHTML reference book to help you
deal with browser differences.
Writing in news:alt.www.webmaster
From the safety of the ISINet, Nova Scotia cafeteria
IMO that is the best course of action unless you /need/ to support a
particular browser and then you must, of course, learn it's deviations
- » looking for host where we can run a custom spam filter
- — Next thread in » Webmaster Forum