Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The DOM is the DOM, and the JavaScript implementation is simply a separate entity. The DOM represents a set of facilities that a web browser exposes to the JavaScript environment. There's no <em>requirement</em> however that any particular JavaScript runtime will have <em>any</em> facilities exposed via the global object.</p> <p>What Node.js is is a stand-alone JavaScript environment <em>completely independent</em> of a web browser. There's no intrinsic link between web browsers and JavaScript; the DOM is <strong>not</strong> part of the JavaScript language or specification or anything.</p> <p>I use the old Rhino Java-based JavaScript implementation in my Java-based web server. That environment also has nothing at all to do with any DOM. It's my own application that's responsible for populating the global object with facilities to do what I need it to be able to do, and it's not a DOM.</p> <p>Note that there are projects like <a href="https://github.com/tmpvar/jsdom">jsdom</a> if you want a virtual DOM in your Node project. Because of its very nature as a server-side platform, a DOM is a facility that Node can do without and still make perfect sense for a wide variety of server applications. That's not to say that a DOM might not be useful to some people, but it's just not in the same category of services as things like process control, I/O, networking, database interop, and so on.</p> <p>There may be some "official" answer to the question "why?" out there, but it's basically just the business of those who maintain Node (the Node Foundation now). If some intrepid developer out there decides that Node should ship by default with a set of modules to support a virtual DOM, and successfully works and works and makes that happen, then Node <em>will</em> have a DOM.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload