writing for both DOMs

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jeff Gutsell

    #1

    writing for both DOMs

    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 "parentElem ent" in IE. The
    script doesn't work at all in Firefox but I can't tell yet if that's
    the problem.
  • Martin Honnen

    #2
    Re: writing for both DOMs



    Jeff Gutsell wrote:
    [color=blue]
    > 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?[/color]

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

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

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/

    Comment

    • Michael Winter

      #3
      Re: writing for both DOMs

      On 9 Nov 2004 05:43:31 -0800, Jeff Gutsell <jeffgutsell@fu se.net> wrote:
      [color=blue]
      > Are there any reasonably complete online references for scripting with
      > both the W3C DOM and the MS DOM?[/color]

      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]
      [color=blue]
      > Right now I'm working on a script that uses "parentElem ent" in IE. The
      > script doesn't work at all in Firefox but I can't tell yet if that's the
      > problem.[/color]

      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

      --
      Michael Winter
      Replace ".invalid" with ".uk" to reply by e-mail.

      Comment

      • Randy Webb

        #4
        Re: writing for both DOMs

        Michael Winter wrote:

        <--snip-->
        [color=blue]
        > 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).[/color]

        http://msdn.microsoft.com/library/de...nformation.asp

        Something like that?
        Or is the offline version more in depth than that?

        But the browser version is irrelevant. Whats important is what version
        of the JScript Engine it is supported in.
        --
        Randy
        comp.lang.javas cript FAQ - http://jibbering.com/faq

        Comment

        • Michael Winter

          #5
          Re: writing for both DOMs

          On Tue, 09 Nov 2004 12:30:23 -0500, Randy Webb <HikksNotAtHome @aol.com>
          wrote:

          [snip]
          [color=blue]
          > [Tree version of link below][/color]

          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:

          <URL:http://msdn.microsoft. com/library/en-us/script56/html/js56jsoriversio ninformation.as p>
          [color=blue]
          > Something like that?[/color]

          That's for the JScript implementation.
          [color=blue]
          > Or is the offline version more in depth than that?[/color]

          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.
          [color=blue]
          > But the browser version is irrelevant. Whats important is what version
          > of the JScript Engine it is supported in.[/color]

          True.

          Mike

          --
          Michael Winter
          Replace ".invalid" with ".uk" to reply by e-mail.

          Comment

          • Randy Webb

            #6
            Re: writing for both DOMs

            Michael Winter wrote:
            [color=blue]
            > On Tue, 09 Nov 2004 12:30:23 -0500, Randy Webb <HikksNotAtHome @aol.com>
            > wrote:
            >
            > [snip]
            >[color=green]
            >> [Tree version of link below][/color]
            >
            >
            > 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:
            >
            > <URL:http://msdn.microsoft. com/library/en-us/script56/html/js56jsoriversio ninformation.as p>
            >
            >[color=green]
            >> Something like that?[/color]
            >
            >
            > That's for the JScript implementation.[/color]

            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.
            [color=blue][color=green]
            >> Or is the offline version more in depth than that?[/color]
            >
            >
            > The offline library states what object model methods, objects and
            > properties apply to which HTML element, in what IE version and on what
            > platform.[/color]

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

            --
            Randy
            comp.lang.javas cript FAQ - http://jibbering.com/faq

            Comment

            Working...