Client-side and server-side scripts

On a dynamic website there are client-side and server-side scripts. Client-side and server-side are sometimes referred to as front-end and back-end. The client-side of a website refers to the web browser and the server-side is where the data and source code is stored.

Different types of processing can occur at each side.

Twitter's James Harlow explains the difference between back-end and front-end

Client-side scripts

A client-side script is a program that is processed within the client browser. These kinds of scripts are small programs which are downloaded, compiled and run by the browser. JavaScript is an important client-side scripting language and widely used in dynamic websites. The script can be embedded within the HTML or stored in an external file.

External scripts are sent to the client from the server when they are requested. Scripts can also be executed as a result of the user doing something like pressing a page button.

Client-side scripts can often be looked at if the user chooses to view the source code of the page. JavaScript code is widely copied and recycled.

Server-side scripts

A server-side script is processed on the web server when the user requests information. These kinds of scripts can run before a web page is loaded. They are needed for anything that requires dynamic data, such as storing user login details. Some common server-side languages include PHP, Python, Ruby and Java. These execute like programming languages on the server.

When a server-side script is processed, the request is sent to the server and the result is sent back to the client. This is useful for websites which store large amounts of data, such as search engines or social networks - it would be very slow for the client browser to download all the data.