Introduction to JSS (Javascript Server-Side)

CompleteFTP supports Javascript Server-Side (JSS). This means Javascript (normally only served up for execution in the browser) can be executed on the server, and the results served to the browser.

This opens up server-side development to Javascript developers who previously were confined to working in the browser. It helps leverage their skills much further. JSS is ECMAScript 3 compliant, so nearly all Javascript syntax in common use is supported.

There are three main aspects to JSS:

  1. All web application code is in the one language - Javascript. All server-side code is in Javascript.
  2. It is very easy for clients (i.e. browser applications) to call Javascript functions on the server. This is known as Remote Procedure Calls (RPC), because the browser makes calls to Javascript functions that are running remotely on the server.
  3. It supports serving of basic HTTP requests on the server side to write out HTML pages for display in the browser.

How does it work?

When JSS is enabled (see below), any file on the server that has the extension .jss will be assumed to contain Javascript and will be interpreted on the server. That's it!

The main features of JSS are described in detail here.

Why use JSS?

There are some good reasons for doing so:

  1. Javascript developers can now write server-side web applications in the language they are familiar with.
  2. JSS is standards compliant, so developing in JSS does not irrevocably commit developers to CompleteFTP.
  3. JSS is easy to use!

Enabling JSS

A file with a .jss extension will be run as JSS if:

  1. JSS is enabled on the site serving up the page
  2. JSS is enabled for the user who owns the folder that contains the file

If both of these conditions are not satisfied then the file will be served up the same as an non-JSS file.