Difference Between Client Side Scripting and Server Side Scripting

The main difference between client side scripting and server side scripting is that the client side scripting is used to write scripts that are executed in the client side or browser while the server side scripting is used to write scripts that are executed in the server side or the server.

The web works according to the client server model. Furthermore, the devices or programs that request services are called hosts or clients. These devices or programs that respond by providing services are called servers. In other words, the client initiates the communication, and the server accepts the request and responds to the client. Describing further, a script is a set of instructions that can be executed on another program or an application. And, this scripting languages can be divided into client side or server side scripting based on the side the script executes.

Key Areas Covered

1. What is Client Side Scripting
     – Definition, Functionality
2. What is Server Side Scripting
     – Definition, Functionality
3. What is the Difference Between Client Side Scripting and Server Side Scripting
     – Comparison of Key Differences

Key Terms

Client Side Scripting, CSS, HTML, Server Side Scripting, Scripting Languages

Difference Between Client Side Scripting and Server Side Scripting - Comparison Summary

What is Client Side Scripting

Client side scripting is used to generate a code that executes in the client side web browser. Therefore, it does not require any server side processing. Usually, client side scripts are placed inside an HTML document. Hence, this type of scripting can reduce the server load. When a user requires a specific web page through the browser, the server sends an HTML file in which the browser can interpret and render the content in the client side.

Difference Between Client Side Scripting and Server Side Scripting

Figure 1: Client Side and Server Side

The main client side scripting languages are HTML, CSS, and JavaScript. HTML stands for HyperText markup language. It is used to build the structure of the web page. CSS stands for Cascading Style Sheet, and it is a designing language used to add styling to the web page. JavaScript is a server side scripting language that is used to add user interactions and to make the web page more dynamic.

What is Server Side Scripting

Server side scripting is used to generate a code that executes on the web server. Therefore, a script that can run on the web server is known as a server side script. Concerning the applications, the server side scripting languages can be used to make dynamic changes in the website content, to access database, to generate responses to the user’s queries.

When the browser requests a web page, the web server processes the script and provides the webpage to the browser. This processing can involve obtaining data from a database, performing calculations and providing the required content to the client. Finally, the script is processed and the output is displayed in the browser.  Programming languages such as Java, Python, PHP, and Ruby are common languages to write server side scripts. These languages can be easily integrated with databases such as MySQL, MSSQL, and Oracle.

Difference Between Client Side Scripting and Server Side Scripting

Definition

Client side scripting is a technique used in web development that involves using scripts that runs on the client machine’s browser. Server side scripting is a technique used in web development that involves using scripts on the web server to produce a response that is customized for each client’s request to the website.

Functionality

Hence, from the above, we can understand that the client side scripting is executed in the client side or the web browser while the server side scripting is executed in the back end or the web server. This is the basic difference between client side scripting and server side scripting.

Languages

Some client side scripting languages are PHP, Python, Java, Ruby, and ASP.NET while some server side scripting languages are HTML, CSS, and JavaScript.

Security

Security is an important difference between client side scripting and server side scripting. While server side scripting provides more security for the data, client side scripting does not provide much security for the data.

Conclusion

The difference between client side scripting and server side scripting is that client side scripting is used to write scripts that are executed in the client side or browser while server side scripting is used to write scripts that are executed in the server side or the server.

Reference:

1. “Server-Side Scripting.” Wikipedia, Wikimedia Foundation, 10 June 2018, Available here.

Image Courtesy:

1. “Scheme dynamic page en” By GgiaEsquema-proxy-internet.svg: Randomicc – Own work (CC BY-SA 3.0) via Commons Wikimedia

About the Author: Lithmee

Lithmee holds a Bachelor of Science degree in Computer Systems Engineering and is reading for her Master’s degree in Computer Science. She is passionate about sharing her knowldge in the areas of programming, data science, and computer systems.

Leave a Reply