본문으로 건너뛰기

How Web Browsers Work

What is a Browser?

A browser is a program that allows us to view and interact with web pages and web applications. Examples of browsers include Chrome, Firefox, Safari, and Edge.


Browser Operation Process

The operation process of a browser is as follows:

1. Requesting Data: When a user enters a URL, the browser requests the corresponding page from a web server.

2. Receiving Data: The web server sends files such as HTML, CSS, JavaScript necessary to display the website to the browser.

3. Rendering: The browser interprets (parses) the received files and displays them on the screen.


How Browsers Work

A web page is essentially a long list of text and code.

The process by which a browser reads and understands this code is called 'parsing'.

The browser turns the result of its understanding into a tree-like structure, known as the 'DOM (Document Object Model) tree'.

Each branch of the tree represents an element of the web page, such as titles (h), images (img), buttons (button), etc.

Through the DOM tree, JavaScript can access each element of the web page, modify HTML elements, or interact with them.

The DOM tree creates a nervous system for the website, with JavaScript acting as the brain, controlling the website.

For example, when a user clicks a button, JavaScript finds the corresponding button in the DOM tree and executes the code to be run upon clicking.

We will learn more about the DOM in the next lesson.