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. Here, the host or client refers to the devices or programs that request the services. On the other hand, server refers to the devices or programs that respond by providing services to these requests. 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, based on the side the script executes, can be either client side scripting or server side scripting .

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 generates 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 generates a code that executes on the web server. Therefore, the server side script got its name as it runs on the web server. Concerning the applications, the server side scripting languages are useful in making 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. Here, the processing involves 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. We can easily integrate these language with databases such as MySQL, MSSQL, and Oracle.

Difference Between Client Side Scripting and Server Side Scripting

Definition

Client side scripting is a technique in developing web pages and uses scripts that runs on the client machine’s browser. On the other hand, server side scripting is a technique in developing web pages and uses the scripts on the web server to produce customized response 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

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

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