Client-side and Server-side JavaScript - CSJS vs. SSJS
(Page 4 of 6 )
The table below compares CSJS and SSJS. Note that the only syntactical difference between CSJS code and SSJS code is that for CSJS you use a <SCRIPT> tag rather than a <SERVER> tag in your HTML document. Remember, however, that SSJS provides a different set of objects from CSJS -- if you try to use CSJS objects in your server application, errors will result. Note that CSJS can be served by any server but only displayed by JavaScript-enabled browsers. SSJS must be served by a JavaScript-enabled server but can be displayed by any browser.
| CSJS | SSJS |
Tags | <SCRIPT> | <SERVER> |
Execution | Client browser (interpreted) | Server (compiled into SSJS byte code) |
Compilation | Not compiled | Application file (.web) |
Client | JavaScript-enabled | Any browser |
Server | Any server | JavaScript-enabled |
You've probably heard the terms Livewire and server-side JavaScript used interchangeably, but they're two distinctly different technologies. When Livewire was released as a product by Netscape in 1996, it contained site management utilities and provided database connectivity via SSJS on Netscape Enterprise Server 2.0. In 1997, Livewire was included with Enterprise Server 3.0, so it's no longer a separate product. Netscape began to refer to the database access engine itself as Livewire and to distinguish it from the language that the database applications are written in, SSJS.
The diagram below shows how SSJS interacts with LiveWire to connect with a variety of databases (DB2, Informix, Oracle, Sybase, and ODBC-compliant databases). SSJS provides developers with a collection of objects (such as the database, DbPool, and cursor objects) that interact with the LiveWire database access engine to communicate with a database. At the same time, some of the objects that are part of SSJS (the file, SendMail, and state management objects) do not interact with LiveWire. Remember that LiveWire involves database access only, whereas SSJS encompasses database access and additional server-side functionality.

Next: SSJS VS. CGI >>
More JavaScript Articles
More By Ibama Supreme Tmunotein