[whatwg] Partial HTML5 documents

Garrett Smith dhtmlkitchen at gmail.com
Tue Dec 7 23:45:35 PST 2010

On 9/9/10, Rostislav Hristov <rostislav.hristov at gmail.com> wrote:
> Hello,
> I'm looking for a way to define valid partial HTML fragments that can
> be included into other documents using a server-side language or
> injected using AJAX. The current specification doesn't have any major
> restrictions in this area but it always require the presence of a
> TITLE tag which in this specific case is not needed. Does anybody have
> an idea if the TITLE can be skipped somehow or how this whole thing
> can be implemented properly? Do you think it should be specified?

I may have misunderstood, but it sounds like you might be able to use

Example copy'n'pasted from c.l.js:

var s = "<script>alert(1)</script>";
var range = document.createRange();
var documentFragment = range.createContextualFragment(s);

More information about the whatwg mailing list