Skip to content

Instantly share code, notes, and snippets.

@cho45
cho45 / createHTMLDocument.js
Created January 20, 2009 12:43
createHTMLDocument
function createHTMLDocument (title) {
// Firefox doesn't have createHTMLDocument
if (!document.implementation.createHTMLDocument) {
// Maybe this is the best way to create HTMLDocument, but not worked in any browser...
// var html4dt = document.implementation.createDocumentType("HTML", "-//W3C//DTD HTML 4.01//EN", "http://www.w3.org/TR/html4/strict.dtd");
// var d = document.implementation.createDocument("", "HTML", html4dt);
// return d;
// In Firefox
// Try to create HTMLDocument from XSLT with <xsl:output method='html'/>