Client Side Vs Server Side Java Script

A

Ankur

Hi Folks,

I am new for this group. I want to clarify one thing what's a basic
difference between Client Side Java Script and Server Side Java
Script. how we can differentiate it. Why we called this kind of script
"Server Side Java Script".

I am in confusion because according to lots of web developer Java
Script is a client side scripting language. We can not say it Server
Side Java Script.

So let's have a discussion over this topic. Any clarification abt this
would be appreciable.

Thanks in advance
 
J

Julian Turner

Hi Folks,

I am new for this group. I want to clarify one thing what's a basic
difference between Client Side Java Script and Server Side Java
Script. how we can differentiate it. Why we called this kind of script
"Server Side Java Script".

I am in confusion because according to lots of web developer Java
Script is a client side scripting language. We can not say it Server
Side Java Script.

So let's have a discussion over this topic. Any clarification abt this
would be appreciable.

Thanks in advance

Fundamentally there are not two different specifications of
JavaScript, one for the client and one for the server: it is the same
JavaScript, just run in a different context.

Your starting point is the language specification, which is
formalised as "ECMAScript" - http://www.ecmascript-lang.org/. It is
currently at Edition 3, but Edition 4 (backwards compatible) is in the
pipeline.

Any application wishing to use ECMAScript must create its own
implementation of the language specification.

FireFox (Mozilla, Netscape) have their implementations (Rhino and
Spidermonkey) of Edition 3, and their current version is JavaScript
1.7 I believe.

Microsoft's implementation is called JScript, currently at version
5.6.

Edition 4 (which introduces namespaces, classes etc) is not yet
formally implemented, although ActionScript (Adobe Flash), and
JScript.NET (Microsoft .NET) implement substantial parts of it.

Any differences you encounter in different language implementations
will largely be down to how much of Edition 3 (or 4) has been
implemented, and whether the implementer has added anything else
outside the formal specification.

In terms of implementations in browsers, you can rely on all of the
latest browsers now having virtually complete implementations of
Edition 3.

In terms of "client side" or "server side", this is a question about
how ECMAScript is *used*, not what it is, or is not. The language
specification says nothing about the environment in which it is run.
From my understanding:-

(a) Client Side

When scripts are downloaded over the internet or an intranet by a web
browser as part of a web page, and run in that web browser, that usage
is termed "client side".

Those scripts cannot talk to the server from which they were
downloaded, except indirectly through some remote scripting means,
such as the XMLHttpRequest object.

Client side usage is by far the predominant usage of JavaScript.

(b) Server Side

Where you have a program running on a web server to dynamically
generate your web pages, talk to databases etc, then this is known as
"server side scripting" (http://en.wikipedia.org/wiki/Server-
side_scripting).

Whether ECMAScript is used as a scripting language on the server
depends what program you are using.

The main two I am aware of that use ECMAScript are classic ASP and
ASP .NET

If you are using classic ASP, then JScript 5.6 will be available (as
well as VBScript), although the Sun One ASP Server uses a buggy
JScript 5.1 implementation.

In relation to ASP.NET, JScript.NET is one of the languages that is
supported I believe, although C# and VisualBasic a Microsoft's main
focus with .NET.

Other examples are given here : http://en.wikipedia.org/wiki/Server-side_JavaScript

Regards

Julian Turner
 
D

David Dorward

I am new for this group. I want to clarify one thing what's a basic
difference between Client Side Java Script and Server Side Java
Script. how we can differentiate it. Why we called this kind of script
"Server Side Java Script".

One runs in the browser (the client), the other runs on the server
(the web server).
I am in confusion because according to lots of web developer Java
Script is a client side scripting language. We can not say it Server
Side Java Script.

Almost all JavaScript is client side. The majority of web developers
probably don't even realize that server side implementations exist.
The truth is that is is just a programming language and not specific
to server or client.
 
A

Ankur

Thanks


Fundamentally there are not two different specifications of
JavaScript, one for the client and one for the server: it is the same
JavaScript, just run in a different context.

Your starting point is the language specification, which is
formalised as "ECMAScript" -http://www.ecmascript-lang.org/. It is
currently at Edition 3, but Edition 4 (backwards compatible) is in the
pipeline.

Any application wishing to use ECMAScript must create its own
implementation of the language specification.

FireFox (Mozilla, Netscape) have their implementations (Rhino and
Spidermonkey) of Edition 3, and their current version is JavaScript
1.7 I believe.

Microsoft's implementation is called JScript, currently at version
5.6.

Edition 4 (which introduces namespaces, classes etc) is not yet
formally implemented, although ActionScript (Adobe Flash), and
JScript.NET (Microsoft .NET) implement substantial parts of it.

Any differences you encounter in different language implementations
will largely be down to how much of Edition 3 (or 4) has been
implemented, and whether the implementer has added anything else
outside the formal specification.

In terms of implementations in browsers, you can rely on all of the
latest browsers now having virtually complete implementations of
Edition 3.

In terms of "client side" or "server side", this is a question about
how ECMAScript is *used*, not what it is, or is not. The language
specification says nothing about the environment in which it is run.


(a) Client Side

When scripts are downloaded over the internet or an intranet by a web
browser as part of a web page, and run in that web browser, that usage
is termed "client side".

Those scripts cannot talk to the server from which they were
downloaded, except indirectly through some remote scripting means,
such as the XMLHttpRequest object.

Client side usage is by far the predominant usage of JavaScript.

(b) Server Side

Where you have a program running on a web server to dynamically
generate your web pages, talk to databases etc, then this is known as
"server side scripting" (http://en.wikipedia.org/wiki/Server-
side_scripting).

Whether ECMAScript is used as a scripting language on the server
depends what program you are using.

The main two I am aware of that use ECMAScript are classic ASP and
ASP .NET

If you are using classic ASP, then JScript 5.6 will be available (as
well as VBScript), although the Sun One ASP Server uses a buggy
JScript 5.1 implementation.

In relation to ASP.NET, JScript.NET is one of the languages that is
supported I believe, although C# and VisualBasic a Microsoft's main
focus with .NET.

Other examples are given here :http://en.wikipedia.org/wiki/Server-side_JavaScript

Regards

Julian Turner
 
D

Dr J R Stockton

In comp.lang.javascript message <[email protected]
glegroups.com>, Thu, 28 Jun 2007 09:06:55, David Dorward
One runs in the browser (the client), the other runs on the server
(the web server).


Almost all JavaScript is client side. The majority of web developers
probably don't even realize that server side implementations exist.
The truth is that is is just a programming language and not specific
to server or client.

--
DSS.

Javascript is not exclusively used client- or server- side; there is
more to computing than the Web.

Javascript can also be used within Web-type pages run locally in a
browser (web pages can be tested that way in development, though that is
not the only local use).

Javascript can also be executed in Windows Scripting Host - there,
VBScript is more common, which shows the benighted ignorance of the
average * programmer.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top