Browser DevTools

5.Server or Browser?

A

In this chapter

We'll learn the debugger built into every web browser — DevTools — and its four most useful tabs: Elements, Console, Network and Sources, explained as a car's dashboard, warning lights, delivery log and engine view.

12–14 min

The Problem in Real Life

The fix is running on staging (Act 19 explains staging properly — for now, a private copy of the real site for testing). Anna opens the Riverside Arena page in Chrome. 8:00 PM. She's ready to celebrate.

John presses F12. A panel slides open from the side of the browser, full of tabs. "Before you celebrate, let's ask the browser what really happened. Your server can tell you one side of the story. The browser can tell you the other."

J

The page is what the user sees. DevTools is what actually happened.

John

Looking at the Page vs. Looking Under the Bonnet

The browser does a lot of work

It downloads files, calls APIs and runs JavaScript. Any of those steps can go wrong.

Server or browser?

When a page is wrong, the first question is: did the server send bad data, or did the browser show it badly?

Hidden errors

JavaScript errors in the browser don't show on the page — they only show in the console.

Browser DevTools: Elements, Console, Network and Sources

The car analogy: driving, you only see the road. But a mechanic plugs into the car and sees much more: the dashboard of every part, the warning lights, a log of everything that came in and out, and a view of the engine while it runs. Every browser has this built in, called DevTools. Open it with F12 (or right-click → Inspect, or Cmd+Option+I on a Mac).

  • Elements — the dashboard of the page: shows the page's HTML (Act 12) as a live tree, plus the CSS styles on each element. Click any element on the page to find it in the tree. You can even edit text and styles live to try ideas — changes disappear when you reload.
  • Console — the warning lights: shows JavaScript errors (red), warnings (yellow) and messages from console.log. A page can look fine and still have red errors here. You can also type JavaScript into it and run it on the page, like a tiny terminal.
  • Network — the delivery log: lists every request the page makes (Acts 12 and 13): HTML, CSS, images, API calls. For each one: the URL, method (GET, POST), status code (200, 404, 500), size and how long it took. Click one to see the request and the response — headers and body, including the JSON an API returned. This answers the most important question: did the server send the right data?
  • Sources — the engine view: shows the JavaScript files the browser is running, and has a full debugger — the same breakpoints, stepping and watches from chapter three, but for code running in the browser.
  • Other useful tools: Application shows cookies and local storage (Act 12's wristbands). Device mode pretends to be a phone screen. Performance and Lighthouse measure how fast the page is.
Table — The four main DevTools tabs
TabCar versionUse it to...
ElementsThe dashboardInspect and live-edit HTML and CSS
ConsoleWarning lightsSee JavaScript errors and warnings; run JavaScript
NetworkThe delivery logSee every request, status code and response
SourcesThe engine viewDebug browser JavaScript with breakpoints
Table — What the Network tab showed for the event request
FieldValue
RequestGET /api/events/riverside-arena-1114
Status200 OK
Time84 ms
startsAt2026-11-14T20:00:00Z
venueTimeZoneEurope/London
displayTime8:00 PM
Useful things to type into the Console
Intl.DateTimeFormat().resolvedOptions().timeZone // which timezone this browser uses
new Date("2026-11-14T20:00:00Z").toString() // the show time in this browser's timezone
document.querySelector(".show-time").textContent // the text actually on the page

Anna's check — server or browser: In the Network tab she reloads the page and clicks the request GET /api/events/riverside-arena-1114. Status 200. The response JSON has "startsAt": "2026-11-14T20:00:00Z", "venueTimeZone": "Europe/London" and "displayTime": "8:00 PM". The server is now sending the right data. Good.

A second, hidden problem: in the Console, one yellow warning: the "Starts in 3 hours" countdown under the time is calculated in the browser. She opens Sources, finds countdown.js, sets a breakpoint and steps through it. The countdown uses the difference between two moments in time — startsAt minus now — which is the same everywhere in the world. No timezone involved, so it's correct. The warning turns out to be about a slow image. She notes it for later.

Testing from "another country": DevTools can also pretend the browser is somewhere else (in the Sensors panel, she can override the timezone). She sets it to Asia/Tokyo and reloads. The page still says the show is at 8:00 PM London time — exactly what a fan in Tokyo needs, because the show happens in London.

Key Takeaway

DevTools (F12) is the browser's built-in mechanic's kit. Elements shows the live HTML and CSS, Console shows hidden errors and runs JavaScript, Network logs every request with its status and response — telling you whether the server sent the right data — and Sources has a full debugger for browser code. When a page is wrong, first ask: server or browser?

Why This Matters

Almost every web bug passes through the browser, and DevTools is where you see it. The Network tab alone settles countless arguments between frontend and backend developers — "is the API wrong, or the page?" — in seconds. Every web developer uses DevTools every day, and it's free in every browser.

Server: correct. Browser: correct. Every timezone she tries: correct. Anna opens the pull request. John reviews it and leaves one comment: "Where's the test? Without one, this bug is just on holiday."