Every time you open a website, a small conversation happens in about a second. Understanding it makes everything else in this course easier.
The journey of a web page
- You type
vjclasses.ininto the browser (Chrome, Firefox, Safari). - The browser asks the DNS (Domain Name System), the internet’s phone book, for the IP address of that domain, a number such as
203.0.113.10. - The browser connects to the server at that address and sends an HTTP request: “please send me the page
/courses”. - The server finds or builds the page and sends back an HTTP response: a status code and the content.
- The browser reads the HTML, then fetches the CSS, JavaScript and images it mentions, and draws the page.
Front end and back end
- The front end is what runs in the browser: HTML (structure), CSS (presentation) and JavaScript (behaviour).
- The back end runs on the server: languages such as PHP, Python or Node.js, and databases such as MySQL. It builds pages on the fly, saves form data, handles logins and payments.
A simple “brochure” site can be front end only. A site with logins, orders or a blog needs a back end too.
HTTP status codes worth knowing
| Code | Meaning |
|---|---|
| 200 | OK: here is the page |
| 301 | Moved permanently (a redirect) |
| 404 | Not found |
| 403 | Forbidden |
| 500 | Server error: something broke on the server |
HTTP and HTTPS
HTTPS is HTTP sent through an encrypted connection (TLS). It protects passwords and form data from being read in transit, and browsers mark plain HTTP sites as “Not secure”. Every site today should use HTTPS; we will switch it on in the publishing lesson.
Your tools
You need only two things to start: a browser and a code editor. Install Visual Studio Code (free). Also learn your browser’s developer tools (press F12): the Elements tab shows the page’s HTML and CSS, the Console shows JavaScript errors, and the Network tab shows every request and its status code.
Try this
Open any website and press F12. In the Network tab, reload the page. Find the first request (the HTML document), its status code, and how many other files the page loaded. Which took the longest?
Key points
- Browser asks DNS for the IP, sends an HTTP request, receives a response, then fetches CSS, JS and images.
- Front end: HTML, CSS, JavaScript in the browser. Back end: server code and databases.
- Learn the common status codes: 200, 301, 404, 500.
- HTTPS encrypts traffic; every site should use it.