17

Will any one please explain me what is server side java script and client side java script

Because I recently heard about livewire JavaScript is server side and navigator JavaScript is client-side.

Kindly any one explain me the difference.

RBT
  • 24,161
  • 21
  • 159
  • 240
Fero
  • 12,969
  • 46
  • 116
  • 157
  • 2
    If you would like to know why someone would use Server Side JS you can check http://stackoverflow.com/questions/459238/when-and-how-do-you-use-server-side-javascript – Preets Sep 10 '09 at 10:11
  • What is `livewire JavaScript` and `navigator JavaScript`? – Timo Apr 15 '21 at 09:00
  • Netscape Navigator was a popular browser in the late 90's. Livewire JavaScript was a server-side JavaScript interpreter that ran on the Netscape brand web server. This must be a repost from Yahoo answers or something because those technologies were not much used past the year 2000 – Michael Mullany Apr 25 '21 at 13:04

8 Answers8

27

There are 3 major types of JavaScript namely:

  1. Client-Side JavaScript (CSJS) -- an extended version of JavaScript that enables the enhancement and manipulation of web pages and client browsers

  2. Server-Side JavaScript (SSJS) -- an extended version of JavaScript that enables back-end access to databases, file systems, and servers

  3. Core JavaScript -- the base JavaScript language

Client-Side JavaScript (CSJS) and Server-Side JavaScript (SSJS) are dependent on the core JavaScript and cannot work without it.

Source

rahul
  • 184,426
  • 49
  • 232
  • 263
10

For most part in the modern web, javascript is 99% times client side (yes I made up the statistic).

That said, javascript is just another language. Back in the olden days, there was the Netscape Enterprise Server (NES it was called) which allowed scripting in javascript.

Modern web servers support scripting langauges like php, python etc. Its unfortunate that js is not big on the server side. Its the single most beautiful language I've encountered: the syntax of C, with the power of something like Lisp.

The conventional client side usage of javascript alludes to its use in the web. I'm sure you know all about javascript on the web (if you are intelligent enough to ask about ssjs).

But some unconventional uses of javascript:

  • However, Qt has found use for javascript in its framework. Qt applications can be written to be extensible by addons written in javascript. I think its pretty cool.
  • There is also Rhino, that compiles javascript into Java.

Cheers!

jrharshath
  • 25,975
  • 33
  • 97
  • 127
  • 4
    this is very old which justifies no mention of node.js but Future users should look in to node.js articles to know about serverside javascript – Gaurav Jan 01 '14 at 20:47
  • 2
    With the growth of server side JS this answer hasn't really aged that well. – shuttle87 Jan 10 '20 at 13:21
6

Client vs. server scripting

Client-side scripting Server-side scripting
Runs on the user's computer, i .e. browser interprets the script Runs on the web server
Source code is visible to the user. Source code is not visible to the user because the output of a server-side program is an HTML page.
Used for validations and functionality for the user events Used for business logic and data access from the database. The pages are created dynamically.
Depends on the browser and version. Doesn't depend on the client. Any server-side technology can be used.

You may visit here for details.

karel
  • 5,489
  • 46
  • 45
  • 50
Zulu
  • 150
  • 2
  • 5
3

One runs in the browser (client side), the other runs on the server. JavaScript is commonly believed just to run on browsers- this is incorrect. When I was a classic ASP developer we had the choice of VBScript or JavaScript server side (we also had the choice of JavaScript or VBScript client side too).

RichardOD
  • 28,883
  • 9
  • 61
  • 81
3

These two terms are used in the context of web. Client-side means that the JavaScript code is run on the client machine, which is the browser. Server-side JavaScript means that the code is run on the server which is serving web pages.

Ionuț G. Stan
  • 176,118
  • 18
  • 189
  • 202
3

Client-side javascript allows you to make possible some user interactions, by for instance changing the DOM, adding events to html elements, etc..

On the other hand, server side javascript, allows to exploit the javascript in its entireness by building more scalable, event-driven and non I/O blocking applications. One example of server side javascript environment is NodeJs.

Moreover, in this way the learning curve for both client and backend developers in learning javascript is diminished, since both talk the same language.

Ala
  • 31
  • 1
1

I believe there is no other popular language than javascript which fits exactly as the client side scripting language. Coming to server side language similar to java(works on many servers but popularly apache tomcat),C# and python, javascript can also be used as Server side language best example is NodeJs(similarly Node also needs Node package to be installed on the server to run the script).

for your question navigator being client side JS works on browser and Livewire works on server.

Netscape Navigator 2.0 (and later versions) can interpret JavaScript statements embedded in an HTML page. When Navigator requests such a page, the server sends the full content of the document, including HTML and JavaScript statements, over the network to the client. The Navigator then displays the HTML and executes the JavaScript, producing the results that the user sees.

LiveWire is an application development environment that uses JavaScript for creating server-based applications similar to CGI (Common Gateway Interface) programs. In contrast to Navigator JavaScript, LiveWire JavaScript applications are compiled into bytecode executable files. These application executables are run in concert with a Netscape server (version 2.0 and later) that contains the LiveWire server extension.

Information source

Irfan Syed
  • 113
  • 2
  • 10
-4

Client side java script comprises the basic language and predefined objects which are relevant to running java script in a browser. The client side java script is embedded directly by in the HTML pages. This script is interpreted by the browser at run time.

Server side java script also resembles like client side java script. It has relevant java script which is to run in a server. The server side java scripts are deployed only after compilation. Server-Side JavaScript (SSJS) . It is JavaScript that enables back-end access to databases, file systems, and servers.

  • 1
    This information is incorrect and misleading ("The client side java script is embedded directly by in the HTML pages"...) – Noy Feb 09 '16 at 17:42