crysalead-js / dom-layer

Virtual DOM implementation.
MIT License
30 stars 1 forks source link

mount on document throws #7

Closed ghost closed 9 years ago

ghost commented 9 years ago

@jails If you try to mount on document it throws, but works if you mount on document.body. However it will throw again if you don't have a document.body.

Mounting on document.documentElement works.

jails commented 9 years ago

Yup, it throws an error with document because it's not supposed to with document since it's not a DOM element. And document.documentElement returns the dom element that is the root element of the document (so most of the time the <html> element). But I wouldn't use <html> as a mounting point personally.