In the developer console of your web browser, you can see the document object model of a web page, and you can also see its html source code. The two look similar most of the time, while they play different roles in your browser. Please elaborate the difference between document object model and html source code to a web brower.
The difference between document object model and html source code to a web browser.
When the web server send back the page that we manage to retrieve to a web browser, the web browser will help us parse the web page, render it and display it on the screen. From this process, we can learn that the html source code come from the web server we send a GET request to. Additionally, the html source code is stored at the web server, or may be some database elsewhere. Therefore, the html source code to a web browser is “immutable” to some extend, the web browser which is we users client simply \grab** those text or data from the web server.
However, as for the document object model, the web browser uses many other techniques such as the JavaScript to run this. So in the developer console of the browser, the code we see from the DOM is what the page is \currently** displaying, which is affected by JS program, and is updated instantly as soon as we user do some change in the developer console.
The html source code we get is just a bunch of static text written in the format of html while the DOM is more dynamic and parallel to what we currently see and operate. But as the DOM is built based on the html source code we get from the server, there are a lot of similarities between DOM and source code. The DOM serves as a more powerful tool which embraces the web developer’s developing and debugging. And of course, some small html grammar errors such as lowercase or the uppercase or a missing “end” is more tolerant to our web browser thanks to the DOM.
not bad.
Good English is concise. So, try to avoid redundant words. For instance, the following sentence
“From this process, we can learn that the html source code come from the web server we send a GET request to“
can be shortened to:
“This process indicates that html source code comes from the web server.”
you won’t lose any information.
“the html source code may be some database elsewhere“ is not a corrrect expression.