WebScripting is the process of creating and embedding scripts in a web page.
A script is a list of commands embedded in a web page. Scripts are interpreted and executed by a certain program or scripting engine.
Scripts may be written for a variety of purposes such as for automating processes on a local computer or to generate web pages on the web.
Types of Scripts
There are two types of scripts:
- Client-Side Scripts
- Server-Side Scripts
Client-side scripting enables interaction within a web page.
The client-side scripts are downloaded at the client-end and then interpreted and executed by the browser.
The client-side scripting is browser-dependent. That is, the client-side browser must be scripting enabled in order to run scripts.
Client-side scripting is used when the client-side interaction is used.
Uses of client-side scripting may be:
- to get data from the user's screen or browser
- online games
- customising the display of page in browser without reloading the page, e.g., rollover a hyperlink highlights that link without reloading the page
Server-side scripting enables the completion or carrying out a task at the server-end and then sending the result to the client-end.
In server-side script, the server does all the work, so it does not matter which browser is being used at client-end.
Server-side scripting is used when the information is sent to a server to be processed at the server-end.
Uses of server-side scripting may be:
- password protection
- browser customization or sending information as per the requirement of client-end browser
- form processing
- building and displaying pages created from a data base
- dynamically editing changing or adding content to a web page
Client-Side Vs Server-Side
The table given here compares or tells the differences between the client-side and the server-side scripts:
|Client-Side Scripting||Server-Side Scripting|
|Script code is downloaded and executed at client end||The script is executed at the server-end and the result is sent to the client-end|
|Response to interaction is more immediate once the program code has been downloaded||Complex process are more efficient as the program and associated resources are not downloaded to the browser|
|Services are secure as they do not have access to files and databases||Have access to files and data bases but have security considerations when sending sensitive information|
|Browser dependent||Does not depend on browsers|
|Affected by the processing speed of user's computer||Affected by the processing speed of the host server|
« Previous Tutorial Next Tutorial »