Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to know what is the terminal command for compiling and executing Javascript/HTML.
Is it the same as that of compilation of C program or is it different?

share|improve this question
What are you trying to accomplish? Unless you have some special situation, there's no command for that, since Javascript (and HTML) is sent to the browser in source form. – Scott Severance Dec 18 '11 at 21:34
For javascript and html to be executed on your system you need a webserverr. Have a look at apache. – Rinzwind Dec 18 '11 at 21:47
Rinzwind: no, you don't. You need a server for a server language (like PHP) not for a client language (like Javascript/HTML). You just need a web browser for that, double click on the file and voila, file opened. – Cmorales Dec 18 '11 at 23:38
up vote 6 down vote accepted

HTML is a markup language which is interpreted by a web browser. There is no such thing as compiling HTML.

JavaScript is a dynamic programming language that is executed at runtime by a JavaScript engine. That means JavaScript is not compiled.

As you're mentioning both JavaScript and HTML, read this : JavaScript use in web pages.

The primary use of JavaScript is to write functions that are embedded in or included from HTML pages and that interact with the Document Object Model (DOM) of the page.

I don't really understand what you're trying to do but assuming you've got some .js and .html files, just open the html ones with your browser, like this:

firefox your_stuff.html
share|improve this answer
There is "such a thing" as in Windows CHM files... – user8290 Dec 18 '11 at 23:01
Christopher, I really doubt he was asking about that and I really think the answer above is a good one. – Cmorales Dec 18 '11 at 23:39
@mrpotato Hee-hee! No doubt... I know. Thanks. It was for Maxime to do know that there really is "such a thing" (even though it does not apply to this). – user8290 Dec 19 '11 at 0:19
Haha! I would never have thought of chm files ^^ However i suspect them to be more a compressed compilation of html files rather than compiled html. Also CHM is sometimes referenced as standing for compressed HTML Help metafile, see the french version of the link you gave us or test wget /dev/null;7z e -y;7z e -so RealWorld.chm default.html|more. As for javascript, i'm aware you can do weird thing like compiling it to java, like with Rhino :) – Maxime R. Dec 19 '11 at 17:24

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.