Client-side

Some of the actions on a web page that take place client-side include the following.

Validation rules

Most validation rules will happen on the client-side. For example, if data is required for a form then a warning will be given to the user to type it in. The data will not be sent to the server until it has been entered.

Flash games

Games or animations that use the Flash plug-in will be downloaded to be used on the client-side. Once they are on your computer or device, the code will run within the web browser.

Cookies

Cookies are text files that are stored locally on the client-side. When a user visits a website, it may store a cookie on their computer – the site has to ask the user to accept permission. When they return to that website again, the web page will check for the cookie and if it finds one, it will send it back to the web server. If the user sets up an account with a website that uses cookies, it will remember their details, such as name and login details, the next time they visit (if they have not deleted their internet history). This can save them time, and they will not have to log in or remember their sign-in details every time they use the site.

A graphic illustrating what a cookie is and what it does

Advertising

Cookies and internet history are used to influence the advertisements and other websites recommended to users. The sites pull data from lots of different sources and link it together so that advertising can be targeted more accurately at the consumer.

Social-networking sites invite users to ‘like’ things. These ‘likes’ are stored in databases and are used, along with cookies, to track users’ interests. For example, if a person frequently ‘likes’ products or services associated with sport, or if they visit sport-related websites, they are more likely to see more sport-related adverts and updates in their feed.

This is because their ‘likes’ have been checked and their cookies have been accessed in order to find and display an appropriate advert. This is called target marketing.

Venn diagram illustrating how adverts on social networking sites are chosen

Responsive design

A website may be programmed to automatically adjust the layout depending on the web browser or device that is being used to access the page. For example, web pages are designed to look different on a smartphone compared to a desktop. This is so that the pages fit the different screens.

How responsive design coding can recognise the device the client is using and choose correct viewing of the webpage

In the past, this was a server-side action, with the server delivering a completely different version of the site for desktop or mobile devices. Now, however, this is usually a client-side action – most modern sites have only a single version, with the layout adapting based on device and browser needs. This is done through the use of CSS and JavaScript.