Difference between Server Side and Client Side Languages

In web development, there are mainly two types of scripting languages.

  • Server Side Scripting Language
  • Client Side Scripting Language

Server Side Scripting Language

This is a kind of language that runs on server. You might have heard some of them like PHP, ASP, ASP.net, Coldfusion etc. Let's say that you have a URL 'http://www.example.com/index.php', when you access that URL, the file 'index.php', placed on the server gets compiled and converted into HTML and sent back to the client. The thing worth noting is that the file 'index.php', ran on the server. That's why it is called server side scripting language.

Client Side Scripting Language

This is a kind of language that runs on client side. By client side, I mean browsers. Browsers are the ones who can understand client side scripting language and execute them. These languages include Javascript, VBScript etc. These languages do mostly behavior things like changing an HTML element behavior.

Why client side scripting language is needed?

Let's take an example:
If you want to change the color/size of a button after it is clicked. If there is no client side scripting language, you will have to request the server to provide me that HTML which the button color/size have been changed. This will reload the page and fetch a new one. But due to client side language, we can change the behavior of a button without re-fetching the page from the server.