dopetalk does not endorse any advertised product nor does it accept any liability for it's use or misuse


Our Discord Notification Server invitation link is https://discord.gg/jB2qmRrxyD

Author Topic: DOM - Document Object Model (the Browsers memory pre-HTML)  (Read 11 times)

Offline Chip (OP)

  • Server Admin
  • Hero Member
  • *****
  • Administrator
  • *****
  • Join Date: Dec 2014
  • Location: Australia
  • Posts: 7279
  • Reputation Power: 0
  • Chip has hidden their reputation power
  • Gender: Male
  • Last Login:Today at 02:20:57 AM
  • Deeply Confused Learner
  • Profession: IT Engineer now retired
---

🌿 Why the DOM matters for your SMF search engine
Your ISE engine outputs HTML. 
Opera (and other browsers) then:

- parses it 
- builds a DOM 
- caches the DOM 
- sometimes reuses the DOM 
- sometimes merges old DOM with new DOM 
- sometimes delays repainting 
- sometimes keeps stale JS state 

This is why you saw:

> “Opera loading a page over a previous page without waiting for input.”

That wasn’t PHP. 
That was Opera reusing a stale DOM tree.

If you want to explore this angle: 
Browser cache behaviour

---

🌱 DOM structure (the tree)
Every HTML element becomes a node in the DOM.

Example:

`html
<html>
  <body>
    <div id="search">
      <p>"harm reduction" meth tolerance</p>
    </div>
  </body>
</html>
`

Becomes:

- Document 
  - html 
    - body 
      - div#search 
        - p 
          - text node 

The DOM is literally a tree of objects.

---

🌾 DOM vs HTML (critical distinction)

| Concept | Meaning |
|--------|---------|
| HTML | The static text file sent by your server |
| DOM | The browser’s dynamic, mutable, cached representation of that HTML |

Your PHP outputs HTML. 
The browser builds the DOM. 
JavaScript mutates the DOM. 
Opera caches the DOM. 
Your search engine interacts with the DOM only indirectly.

This distinction explains 90% of “WTF browser behaviour”.

---

🌵 Why the DOM causes weird bugs
Browsers sometimes:

- reuse DOM nodes 
- merge old DOM with new DOM 
- skip rebuilding parts of the DOM 
- keep old JS state attached to DOM nodes 
- repaint only sections of the DOM 
- delay DOM updates until idle time 

This is why your search engine looked “broken” when it wasn’t.

If you want to explore this: 
DOM repaint behaviour

---

🌴 DOM + JS = the living page
Your single JS file interacts with the DOM like this:

- reading values 
- updating elements 
- toggling classes 
- injecting HTML 
- listening for events 
- modifying the tree 

This is why the DOM is called a living document — it changes constantly.

If you want to explore JS interaction: 
DOM manipulation

---

🌲 Why architects care about the DOM
Because the DOM is:

- mutable 
- stateful 
- cached 
- unpredictable across browsers 
- the real “runtime” of your UI 

Your backend (PHP + Python) is deterministic. 
Your DOM is not.

This is why you wisely kept your JS surface tiny — one file, one responsibility.

---

🌱 One strategic question
Do you want to go deeper into:

- DOM events 
- DOM rendering pipeline 
- DOM caching behaviour 

Pick one and I’ll take you deeper.
friendly
0
funny
0
informative
0
agree
0
disagree
0
like
0
dislike
0
No reactions
No reactions
No reactions
No reactions
No reactions
No reactions
No reactions
Our Discord Server invitation link is https://discord.gg/jB2qmRrxyD

Tags:
 

Related Topics

  Subject / Started by Replies Last post
1 Replies
30404 Views
Last post July 08, 2019, 05:34:20 PM
by www.crovellbio.com
0 Replies
22723 Views
Last post May 27, 2021, 09:52:11 PM
by Chip
0 Replies
13365 Views
Last post December 15, 2024, 12:01:03 AM
by Chip
0 Replies
13829 Views
Last post December 15, 2024, 12:03:06 AM
by Chip
0 Replies
17702 Views
Last post April 01, 2025, 03:50:25 AM
by Chip
0 Replies
17115 Views
Last post October 09, 2025, 12:45:24 AM
by smfadmin
0 Replies
379 Views
Last post May 27, 2026, 10:44:04 PM
by Chip
0 Replies
355 Views
Last post June 09, 2026, 11:52:41 PM
by smfadmin
0 Replies
266 Views
Last post June 26, 2026, 10:43:56 PM
by Chip
0 Replies
265 Views
Last post June 26, 2026, 11:34:42 PM
by Chip


dopetalk does not endorse any advertised product nor does it accept any liability for it's use or misuse





TERMS AND CONDITIONS

In no event will d&u or any person involved in creating, producing, or distributing site information be liable for any direct, indirect, incidental, punitive, special or consequential damages arising out of the use of or inability to use d&u. You agree to indemnify and hold harmless d&u, its domain founders, sponsors, maintainers, server administrators, volunteers and contributors from and against all liability, claims, damages, costs and expenses, including legal fees, that arise directly or indirectly from the use of any part of the d&u site.


TO USE THIS WEBSITE YOU MUST AGREE TO THE TERMS AND CONDITIONS ABOVE


Founded December 2014
SimplePortal 2.3.6 © 2008-2014, SimplePortal