Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to "execute" HTML+Javascript page with Node.js

Tags:

jquery

node.js

So, I have my Node.js script. And I have some HTML page which contains HTML with JavaScript (jquery) in it. How can I load it and get result of execution of JavaScript on this page?

like image 989
alexeypro Avatar asked Mar 07 '11 16:03

alexeypro


People also ask

How do I run a JavaScript file in node js?

The usual way to run a Node. js program is to run the globally available node command (once you install Node. js) and pass the name of the file you want to execute. While running the command, make sure you are in the same directory which contains the app.

Can I run JavaScript in node js?

You can run your JavaScript file from your terminal only if you have installed Node. Js in your system.

Can I use HTML with node js?

In Node. js and Express applications, res. sendFile() can be used to deliver files. Delivering HTML files using Express can be useful when you need a solution for serving static pages.


1 Answers

You can check the zombie.js project : http://zombie.labnotes.org/

It should load the page mostly as in a real browser.

like image 155
Jerome WAGNER Avatar answered Oct 06 '22 18:10

Jerome WAGNER