A God DOM Clue

It’s the second week of code school and we’ve built some sweet stuff. Don’t ask me too many details . . . I’m on a journey into ambiguity. . .at this point, my head is down, and my brain a cluster of rusty cogs crunching it’s way towards lubed-up enlightenment.

For this reflection, I’ve fixated on the DOM(DOM dom do0m…). That acronym is one of many that flies around the classroom like cool new slang…slang that is very exclusive. . .and not popular enough to ever be slang.

This is my attempt to get an inkling about the coolness.

DOM stands for Document Object Model. The DOM lives in the browser and brings the JavaScript and HTML codes out of their dormant state in the code-editor to be their dynamic selves on the web page, in the form of buttons and search bars and what-have-ya.

Visually, the DOM looks like a bunch of HTML. But the DOM is just a model, a poser you-might-say. It simply represents the HTML but isn’t the HTML itself. That’s why manipulating the DOM directly in the browser only makes temporary changes to the web page. When it comes to styling a web page, this temporality allows for an experimental frenzy filled with colors, grids, and fonts. It’s a stylish, no-strings-attached fling that screams modernity and can match any skin tone(Hex and RGB!). Once you’ve decided on a style, you can copy and paste your now-fashionable code into your editor!

An aspect of the DOM that I didn’t understand(my darkness is vast) is that the DOM is what allows Javascript to “talk” to the HTML file. My previous perception was that the Javascript “talks” to the HTML through the Javascript link in the HTML file’s script tags. Wrong! The DOM steps in to form a non-sexy love triangle of practical communication and functionality.

I also came to understand that the DOM is an API . . . an Application Programming Interface. I like to focus on the word “interface” to visualize the purpose of an API. It’s a thing that allows interaction. It is the waiter taking and delivering orders.

Alas, knowledge is not always a blessing…I just realized that Santa is probably just an Amazon API.

Here my DOM reflection ends and my exploration resumes.