Client-Side vs. Server-Side Script?

Search

 by Remas Wojciechowski

This short article answers the frequent question about the difference between client-side and server-side scripting.

Scripting languages (VBScript, JavaScript, PerlScript, etc.) can be divided up into core script, client-side script and server-side script. The core script defines the rules, grammar, syntax, core objects, etc. of the language in question. E.g. the fact that you need to end every statement in JavaScript with ; is defined in the core JavaScript.

Core Script
...defines the rules, grammar, syntax, core objects, etc. of the scripting language.
Client-Side Script
...is executed by the browser.
Server-Side Script
...is executed on the server and invisible for the browser.

Client-side and server-side are extensions to the core script. On the whole, they merely add some additional objects, functions, etc. that are specific to the environment they are used in. E.g. in the client-side script you'll have an object that lets you access the HTML document's properties and methods. The server-side script, on the other hand, exposes the Request object that provides an interface to the user's request.

Client-Side Script
...is introduced by the <script> tag.
Server-Side Script
...is introduced by the <script runat="server"> tag.