writing for both DOMs

J

Jeff Gutsell

Are there any reasonably complete online references for scripting with
both the W3C DOM and the MS DOM? I've got the JavaScript Bible at
home but I don't have the CD that came with it, and I find that I'm
often at a location where I need to look something up?

Right now I'm working on a script that uses "parentElement" in IE. The
script doesn't work at all in Firefox but I can't tell yet if that's
the problem.
 
M

Martin Honnen

Jeff said:
Are there any reasonably complete online references for scripting with
both the W3C DOM and the MS DOM? I've got the JavaScript Bible at
home but I don't have the CD that came with it, and I find that I'm
often at a location where I need to look something up?

Unless you care about IE 4 you can pretty much use the W3C DOM for both
Mozilla, Opera, and IE (5, 5.5, 6).
Right now I'm working on a script that uses "parentElement" in IE. The
script doesn't work at all in Firefox but I can't tell yet if that's
the problem.

Use parentNode, parentElement is indeed part of the IE DOM but
parentNode is supported in IE 5 and later.
 
M

Michael Winter

Are there any reasonably complete online references for scripting with
both the W3C DOM and the MS DOM?

Not with both, I believe. Whilst the MSDN Library does list some of the
W3C DOM data, some of it is wrong and unsupported parts are omitted
altogether. I would just use the MSDN version to look up
Microsoft-specific information and the W3C DOM references (or something
equivalent) for the standard stuff.

MSDN:
<URL:http://msdn.microsoft.com/workshop/author/dhtml/reference/dhtml_reference_entry.asp>
W3C: <URL:http://www.w3.org/DOM/DOMTR>

You can download the W3C documents, but I don't think the MS references
can be distributed. If you have a more recent version of Visual Studio, or
some other Microsoft product that contains the MSDN library, the object
model information is located in the Internet Development section. This
particular version is actually very useful as it contains the IE version
number for each feature when it was introduced (something lacking in the
online version).

[snip]
Right now I'm working on a script that uses "parentElement" in IE. The
script doesn't work at all in Firefox but I can't tell yet if that's the
problem.

It is. As far as I can tell, parentElement is a hold-over from the IE 4
object model. Use parentNode instead (unless you're writing for IE 4 too,
in which case use both).

Mike
 
R

Randy Webb

M

Michael Winter

[snip]
[Tree version of link below]

I hate those links. They never work with Opera. Cutting out the
"/library/default.asp?url=" part results in the same page but without the
tree:

Something like that?

That's for the JScript implementation.
Or is the offline version more in depth than that?

The offline library states what object model methods, objects and
properties apply to which HTML element, in what IE version and on what
platform.

Whilst feature detection takes care of what is used, it's quite nice to
know when a particular feature was introduced, especially as I have no way
to check myself.
But the browser version is irrelevant. Whats important is what version
of the JScript Engine it is supported in.

True.

Mike
 
R

Randy Webb

Michael said:
[snip]
[Tree version of link below]


I hate those links. They never work with Opera. Cutting out the
"/library/default.asp?url=" part results in the same page but without
the tree:

Something like that?


That's for the JScript implementation.

Thats not the one I thought it was. There is another one I will post
when I can find it. I hate trying to find anything in that place.
The offline library states what object model methods, objects and
properties apply to which HTML element, in what IE version and on what
platform.

Thats what the one I am hunting lists as well.
Maybe in one of my insomnia fits I can find it again :(
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top