[NEWBIE] extract doctype?

A

Ara.T.Howard

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
===============================================================================
 
M

Martin Honnen

Ara.T.Howard said:
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/d...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.
 
A

Ara.T.Howard

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/d...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
===============================================================================
 

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,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top