Jump to content

JSP = JavaScript?

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1
Ronin

Ronin

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 309 posts
I always thought that JSP was Javascript but on another thread here it is stated to be something else. What is JSP and what is JavaScript then? What are the differences and which is better?

#2
brackett

brackett

    Programmer

  • Members
  • PipPipPipPip
  • 192 posts
JSP = Java Server Pages. It's a server side programming language for delivering customized HTML to a browser. Similar in concept to the myriad web scripting languages out there, like ASP or PHP or ASP.NET (which is technically compiled - but it's close enough).

JavaScript = a scripting language mostly used to drive a browser interface. JavaScript runs client side, and is the only language that has widespread support in browsers (AFAIK, only IE supports alternative languages).

The two have nothing to do with each other, but are normally used in conjunction with each other. The normal scenario goes something like this:
Server Side Language -> HTML + JavaScript -> Browser
The server side language can be JSP, or ASP, etc. The browser displays the HTML, and interprets the embedded JavaScript. At some point, the browser will request another page from the server, which will result in more server side processing (perhaps connecting to a database, verifying authorization, posting a credit card payment, etc.) and a new page of HTML + JavaScript sent down for the browser to display/interpret.