Skip to content Skip to sidebar Skip to footer

DOM Implementation In Pure Javascript?

Is there an implementation or emulation of the DOM which is purely javascript? There is env.js, but that requires Rhino. There's jsdom, but that requires Node. Is there a solut

Solution 1:

In addition to the ones you have listed, I have heard good things about dom.js. It requires limited ES6 features such as const, WeakMap, and Proxy, so it will work in V8 and SpiderMonkey (Rhino) but not JavaScriptCore, Chakra, or others.


Solution 2:

It's hard to guess at exactly what you're trying to do, here, but I'll take a stab at it, just to keep the conversation going:

  • If you're trying to manipulate a DOM from within a browser, can't you just use Jquery?
  • If you're trying to get a "headless browser", I'd check out PhantomJS.

I guess it's hard to imagine how you'd even run Javascript code without a browser, or Rhino, or Node, or PhantomJS, or some other JS interpreter environment...


Post a Comment for "DOM Implementation In Pure Javascript?"