Gees, Louise. Seriously, man? When did “teachers” forget how to “teach” people without using language and terminology and ideas already well-entrenched in the world about which the question is being asked?
I’m trying to become a front end web developer, right? I keep hearing things thrown around about the “DOM” and “APIs” and things like that, and I don’t have a clue what those things are. In my mind right now, the DOM is some abstract home-base for webpages.
But, since I apparently need to know what these things are and how they work in order to become what I’m looking to become, I decided to do a little research. Off to MDN 1I went! (And there I go, doing the very thing I’m bitching about! MDN = Mozilla Developer Network – a great resource for developers & web folk.) I found their “Introduction to the DOM” article. PAYDIRT, right? WRONG! Read this:
Introduction to the DOM
The Document Object Model (DOM) is the data representation of the objects that comprise the structure and content of a document on the web. This guide will introduce the DOM, look at how the DOM represents an HTML document in memory and how to use APIs to create web content and applications.
What is the DOM?
The Document Object Model (DOM) is a programming interface for web documents. It represents the page so that programs can change the document structure, style, and content. The DOM represents the document as nodes and objects; that way, programming languages can interact with the page.
A web page is a document that can be either displayed in the browser window or as the HTML source. In both cases, it is the same document but the Document Object Model (DOM) representation allows it to be manipulated. As an object-oriented representation of the web page, it can be modified with a scripting language such as JavaScript.
For example, the DOM specifies that the
querySelectorAll
method in this code snippet must return a list of all the<p>
elements in the document:JSCopy to Clipboard
const paragraphs = document.querySelectorAll("p"); // paragraphs[0] is the first <p> element // paragraphs[1] is the second <p> element, etc. alert(paragraphs[0].nodeName);
All of the properties, methods, and events available for manipulating and creating web pages are organized into objects. For example, the
document
object that represents the document itself, anytable
objects that implement theHTMLTableElement
DOM interface for accessing HTML tables, and so forth, are all objects.The DOM is built using multiple APIs that work together. The core DOM defines the entities describing any document and the objects within it. This is expanded upon as needed by other APIs that add new features and capabilities to the DOM. For example, the HTML DOM API adds support for representing HTML documents to the core DOM, and the SVG API adds support for representing SVG documents.
https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model/Introduction
Okay, THAT helped… (<- that was sarcasm, dear reader, in case you were unaware) Dude, what? WHAT? That got me zero distance closer to what I need to know. Can’t anyone in the tech world break things down into NORMAL LANGUAGE and explain them to someone? Let’s try, shall we? Use those big brains and the many words you’ve amassed over the years to really think about how a beginner may view things and, as a result, how YOU need to break things down for a beginner!
I think I’m finding a new career direction…
ADDENDUM: Still in search of information I can digest and understand, I did a little search and found this article on Free Code Camp (great site, btw). https://www.freecodecamp.org/news/dom-explained-everything-you-need-to-know-about-the-document-object-model/
Reading now.
ANOTHER ADDENDUM: Never-fucking-mind. *smh* I’m just gonna… keep looking. IF I actually find an article that accurately introduces the DOM and explains it properly for beginners, I will post anew.
Be First to Comment