Repaso
EspaƱol
Frontend & WebFoundationsFE-58

Where does client-side code run, and where does server-side code run?

Options

  1. Both run on the server, never in the browser
  2. Client-side runs in the browser; server-side on a server (Correct option)
  3. Client-side runs in the DB; server-side in the browser
  4. Both run in the billing system of a cloud provider

Answer

Client-side runs in the user's browser or app; server-side runs on a server, which receives requests and sends responses

Why

Client-side code is downloaded to the user's device and runs there: for example the JavaScript that opens a menu when you click.

Server-side code runs on a server you control. It receives requests, talks to the database, checks permissions, and builds the response.

Anything on the client can be seen and changed by the user, so important checks (security, prices) must be repeated on the server.

Remember

Client-side = in the user's browser. Server-side = on your server.

Key terms

Practice this question in Repaso