[NEWBIE] extract doctype?

Discussion in 'Javascript' started by Ara.T.Howard, Jun 15, 2005.

  1. Ara.T.Howard

    Ara.T.Howard Guest

    my understanding of javascript and dom make me think that it's impossible to
    dynamically extract the doctype from the current page - am i correct?

    essentially we're doing some work to dynamically generate footers showing that
    a doccument validate and we'd like to also say __how__ it validated - eg. as
    which doctype - in the footer.

    cheers.

    -a
    --
    ===============================================================================
    | email :: ara [dot] t [dot] howard [at] noaa [dot] gov
    | phone :: 303.497.6469
    | My religion is very simple. My religion is kindness.
    | --Tenzin Gyatso
    ===============================================================================
     
    Ara.T.Howard, Jun 15, 2005
    #1
    1. Advertising

  2. Ara.T.Howard wrote:

    > my understanding of javascript and dom make me think that it's
    > impossible to
    > dynamically extract the doctype from the current page - am i correct?


    Not necessarily, the W3C DOM Level 2 Core defines a property named
    doctype
    for the document which is of type DocumentType and that means it has
    properties named
    publicId
    systemId
    name
    internalSubset
    which give you some information about the document type.

    But the core DOM is about XML and consequently for HTML documents that
    property is in IE only returning null:
    <http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/properties/doctype.asp>

    But Mozilla (tested with 1.7) and Opera 8 do return publicId and
    systemId values for HTML document as well.


    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Jun 15, 2005
    #2
    1. Advertising

  3. Ara.T.Howard

    Guest

    On Wed, 15 Jun 2005, Martin Honnen wrote:

    > Not necessarily, the W3C DOM Level 2 Core defines a property named doctype
    > for the document which is of type DocumentType and that means it has
    > properties named publicId systemId name internalSubset which give you some
    > information about the document type.
    >
    > But the core DOM is about XML and consequently for HTML documents that
    > property is in IE only returning null:
    > <http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/properties/doctype.asp>
    >
    > But Mozilla (tested with 1.7) and Opera 8 do return publicId and systemId
    > values for HTML document as well.


    ah - thanks a lot!

    cheers.

    -a
    --
    ===============================================================================
    | email :: ara [dot] t [dot] howard [at] noaa [dot] gov
    | phone :: 303.497.6469
    | My religion is very simple. My religion is kindness.
    | --Tenzin Gyatso
    ===============================================================================
     
    , Jun 15, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ryan Haskell
    Replies:
    6
    Views:
    8,051
    Ryan Haskell
    Jun 25, 2004
  2. KS
    Replies:
    7
    Views:
    650
    Michael Winter
    Nov 10, 2004
  3. philbo30
    Replies:
    2
    Views:
    300
    Malcolm McLean
    Feb 17, 2007
  4. Anton
    Replies:
    7
    Views:
    329
    Gregory A. Beamer
    Dec 8, 2009
  5. Larry Lindstrom
    Replies:
    19
    Views:
    1,353
    Jonathan N. Little
    Jun 12, 2012
Loading...

Share This Page