1

Is it possible to create dynamic HTML page with Javascript ? Now or tomorrow...

(Is it possible to see javascript replacing PHP, ASP, JSP or ASP.NET ?)

Bastien Vandamme
  • 17,659
  • 30
  • 118
  • 200

4 Answers4

3

It sounds like your question is whether JS can be used for server-side code. The answer is yes - the most popular is certainly Node.js, which I highly recommend.

It's not up to version 1 yet, but it's already being used in production by a bunch of high-profile companies.

For more info, see this SO question.

Community
  • 1
  • 1
Tamzin Blake
  • 2,594
  • 20
  • 36
2

Dynamic HTML (DHTML) is defined as JavaScript + HTML + CSS. From wikipedia:

Dynamic HTML, or DHTML, is an umbrella term for a collection of technologies used together to create interactive and animated web sites by using a combination of a static markup language (such as HTML), a client-side scripting language (such as JavaScript), a presentation definition language (such as CSS), and the Document Object Model.

But, it sounds like you are asking about using JavaScript on the server. ASP uses JavaScript (or vbscript). ASP.Net can use JScript.Net. Node.js is a newer server implementation of JavaScript.

The thing about server technologies like ASP or JSP is that there is more to them than just the programming language. They include frameworks and templating engines. JavaScript can't do this on its own because it requires things like declarative syntax. But, as a language, JavaScript has been used on the server for a long time.

gilly3
  • 87,962
  • 25
  • 144
  • 176
1

Yes, you can take a look at Node.js which is a server implementation of Javascript.

TimPetricola
  • 1,491
  • 2
  • 12
  • 24
0

If you want to do this without any server-side code. Yes you can by using a templating system. You consume all of the site information, usually in JSON format, then generate all HTML client-side.

http://net.tutsplus.com/tutorials/javascript-ajax/quick-tip-an-introduction-to-jquery-templating/

Of course, you need a method to update the data files to make this "dynamic".

Diodeus - James MacFarlane
  • 112,730
  • 33
  • 157
  • 176