From: Axel Dahmen on
Ah, I see... Excellent! That's what I was searching for in the first place.

Thanks a lot!
Axel Dahmen


----------------------------
"Martin Honnen" <mahotrash(a)yahoo.de> schrieb im Newsbeitrag
news:4bb748ab$0$6770$9b4e6d93(a)newsspool3.arcor-online.net...
> Axel Dahmen wrote:
>
>> I'd like to create a HTML document from scratch, but I don't know how to
>> create a "<!DOCTYPE HTML>" element.
>>
>> Can someone please enlighten me?
>
> I don't think the W3C DOM API supports creating HTML 4 documents from
> scratch but you can create an XHTML 1.0 document as follows (in browsers
> like Mozilla, Opera, Safari):
>
> var xhtmlNs = 'http://www.w3.org/1999/xhtml';
>
> var doc = document.implementation.createDocument(xhtmlNs, 'html',
> document.implementation.createDocumentType('html', '-//W3C//DTD XHTML 1.0
> Strict//EN', 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'));
>
> var head = doc.documentElement.appendChild(doc.createElementNS(xhtmlNs,
> 'head'));
> var title = head.appendChild(doc.createElementNS(xhtmlNs, 'title'));
> title.appendChild(doc.createTextNode('Example'));
>
> // add further nodes here
>
>
> --
>
> Martin Honnen
> http://msmvps.com/blogs/martin_honnen/

From: Axel Dahmen on
"Thomas 'PointedEars' Lahn" <PointedEars(a)web.de> schrieb im Newsbeitrag
news:1384178.9SEqChMird(a)PointedEars.de...

> Another possibility is using a `data:' URI for the location of a Window.

I see... Interesting approach. But I can't use this with IE8, I'm afraid.

Cheers,
Axel Dahmen