Home > Blockchain >  Evaluate (run, process) HTML/SVG with embedded JavaScript?
Evaluate (run, process) HTML/SVG with embedded JavaScript?

Time:07-01

How can Node.js (or any other engine) "run" (process, evaluate) HTML or SVG files with embedded JavaScript (that modifies the DOM) and output the resulting document?

CodePudding user response:

It can't. A JavaScript engine by itself has no notion of the HTML or SVG DOM. It would need additional libraries (see comments).

The alternative is to use a Browser to evaluate the file without rendering it ("headless" mode).

  • Related