How this HTML DOM established?
Hi friends!
I am a novice in JavaScript and these days have been reading Danny Goodman's JavaScript Bible(5th Edition). Yesterday while I was going through the section The Document Object Model in Chapter 4, I had a little problem with understanding the HTML DOM established in the book.
In Danny's book, he says the DOM of an empty document in a browser window looks like this: the top node of the entire hierarchy tree is "Window" object; and "Navigator", "Screen", "Document", "History" and "Location" objects are all at the second hierarchy class. Like this:
Window
Â0â2|-----Navigator
Â0â2|-----Screen
Â0â2|-----Document
Â0â2|-----History
Â0â2|-----Location
I don't understand the relationship of these objects. Why is "Window" treated as the top of the whole tree? And why are "Screen", "Navigator" treated as its children?
In my personal opinion, I guess the following model is also acceptable:
Screen
Â0â2|----Navigator
Â0â2Â0â2Â0â2|----Window
Â0â2|----Document
Â0â2|----History
Â0â2|----Location
I think: "Screen" object corresponds to the monitor screen(the physical environment) as explained in the book. It surely contains a "Navigator", which should be a child of "Screen". And a "Navigator" of course contains a window or more, so "Window" should be the child of "Navigator". Then each window in a browser maintains its own current HTML document("Document"), access history("History") and the current URL("Location").
So could someone help me with this DOM question?
Thank you all!
-----------------------------------------------------------------
You'll pay everything back sooner or later if you have owed them.
|