Scripting Technologies-Client Side and Server Side

Web Application Development involves communication between the client browser and the server. The web applications are developed by using different scripting languages in addition to HTML and CSS. The most commonly used scripting  languages/ technologies are JavaScript, VBScript, ASP, Perl, Python, PHP, Ruby on Rails to mention a few.  These scripting technologies can be categorized as Client Side and Server Side Scripting Technologies depending upon where these scripts are executed.

client server scripting technologies

Scripting language codes needs to be embedded in another document like an HTML document since one cannot develop a standalone application with a scripting language unlike a programming language.

Client-side Scripting Technology

In this category the browser of the user requesting a web page executes the scripts written or embedded in the requested web document. When a user requests a web page from the server, the server sends the source code of the requested page to the client machine over the internet.  Browser processes the source code and presents the page to the user.  A user is able to see the code of a client-side scripted page by opening the source (in browser window open view menu  and select “View Source” or right click in the document window in browser and select “View Source” or “View Page Source”).

In case of client side scripting, the processing of the embedded scripts will be done by browser only if the scripting language is enabled on the client browser. Scripts received from the internet may pose security threats since hackers can send the script along with a web page to compromise a computer. It is preferable to disable scripting option to protect a computer from unknown internet threats.  In such case when a page contains a client-side script the browser pops up a message and ask for the user’s permission to run such a script.

Commonly used Client Side Scripting technologies-

  • HTML (Hypertext Markup Language) and CSS (Cascading Style Sheets). CSS is used for page formatting, controlling text size, color, placement and layout. It can also be used to control the timing of appearance of various elements on a webpage.
  • VBScript and JavaScript are used for event handling and controlling results of the defined event
  • Ajax (Asynchronous JavaScript and XML)
  • Java applets for embedding standalone applications in webpages
  • Flash Animation in which the actions are controlled with ActionScript

Server-side Scripting Technology

In this category when a user requests a webpage the script contained in it is executed by the web server and only the results are returned to the client. The user request is responded by the server that runs the script and generates HTML page. This dynamically generated HTML document is sent to the client machine where the browser that displays it to the user. A user is not able to see the code of a server side scripted page by opening the source.

Server-side scripting is a better alternative in case the web application needs to be customised depending on the options chosen by the user or depending upon her requirements. This is the most common mechanism to create interactive web sites like database applications, online stores, feedback or order forms etc.

Commonly used Server Side Scripting languages or technologies-

  • PHP
  • ASP
  • NET
  • Ruby on Rails
  • Perl
  • Python

Difference between Client Side and Server Side Scripting Technologies

Client Side Scripting TechnologiesServer Side Scripting Technologies
Scripts are processed or interpreted by the browserScripts are processed or interpreted by the web server
The response is fasterResponse is slower
The browser receives the source code from the serverThe server sends only the HTML after processing the requested page and script to the browser
The Scripting codes cannot access resources stored at web serverThe Scripting codes can access resources stored at web server
The user can see the source codeThe user can see only the output. She receives the response in form of HTML
Needs to have a scripting language enabled browserDoes not need to have a scripting language enabled browser
No processing overhead on the serverCan result in processing overhead  on server and lowering down the performance of a website
Client-side scripting requires more time and effort from the developers. The dynamic WebPages will be used on any kind of browsers and the developer have to create codes that are compatible with the variety of browsers that the users may use.The source code will be processed by the server so the developer or programmer just has to code the pages according to the scripting technology used on the server.
Client-side code is best option for the applications where the page elements do not depend on the database. Changing the color or look of elements, changing fonts or hiding elements on the basis of user’s choice are examples where Client-side scripting can be used.Server-Side coding is the better option where the data presented to the user is stored in a database. User validation, online reservation, saving data entered by user are examples where Server-side scripting Is needed