FAQ Topic - What is the Document Object Model (DOM)? (2009-11-26)

F

FAQ server

-----------------------------------------------------------------------
FAQ Topic - What is the Document Object Model (DOM)?
-----------------------------------------------------------------------

The Document Object Model (DOM) is a interface-based model for ` Document `
objects. The DOM allows scripts to dynamically access and update a
document's content, style, and event handlers.

The DOM is _not_ part of the ECMAScript programming language.

Official DOM standards are defined by the World Wide Web Consortium.
Scriptable browsers also have proprietary DOM features (

http://msdn.microsoft.com/en-us/library/ms533050(VS.85).aspx


https://developer.mozilla.org/en/DOM_Client_Object_Cross-Reference

),
such as ` document.writeln() `.

Also see the section on

http://jibbering.com/faq/#domRef


http://jibbering.com/faq/#onlineResources

http://www.w3.org/DOM/faq.html

http://www.w3.org/DOM/

https://developer.mozilla.org/en/Gecko_DOM_Reference/Introduction#What_is_the_DOM.3F


The complete comp.lang.javascript FAQ is at
http://jibbering.com/faq/
 
D

Dr J R Stockton

In comp.lang.javascript message <[email protected]
, Thu, 26 Nov 2009 00:00:03, FAQ server <[email protected]> posted:

The Document Object Model (DOM) is a interface-based model for ` Document `
objects. The DOM allows scripts to dynamically access and update a
document's content, style, and event handlers.

The DOM is _not_ part of the ECMAScript programming language.

Above : "The" should be "A".
Official DOM standards are defined by the World Wide Web Consortium.

Since this is a JavaScript FAQ and not a BrowserScript FAQ, that
sentence, which might readily be taken to mean DOM standards for all
purposes, is inappropriate. Remember : JavaScript needs a DOM, and is
not a Web-only language.

DOM standards for browsers are defined by the World Wide Web Consortium.
/or/ The World Wide Web Consortium defines DOM standards for browsers.
Scriptable browsers also have proprietary DOM features (
...
),
such as ` document.writeln() `.

True; but something "always" available in browsers does not make a good
sole example. Quote, or quote also, a proprietary DOM feature available
on at least one, but not all, of the major current browsers ; or don't
say that.



Does JavaScript always run with a DOCUMENT OM? ISTM that it needs an
OM, but that if JavaScript were used to control a machine (not just a
computer), its chief OM would be application-dependent with relatively
little D about it.
 
G

Garrett Smith

Dr said:
In comp.lang.javascript message <[email protected]

Above : "The" should be "A".

The w3c Document Object Model (DOM) is not part of ECMAScript.

The entry does not convey the concept that "The w3c DOM" is not one
specification. It is many specifications (Core, Events, HTML, Style).
Since this is a JavaScript FAQ and not a BrowserScript FAQ, that
sentence, which might readily be taken to mean DOM standards for all
purposes, is inappropriate. Remember : JavaScript needs a DOM, and is
not a Web-only language.

DOM stands for "Document Object Model"; In some environments "Document"
would be meaningless (Flash).

It is important to disambiguate between a hazy "w3c DOM" (many specs)
and the general idea of an browser's scriptable object model, which
includes window, screen, and navigator. The term "BOM" (Browser Object
Model) does that, but is not a common term, so seems unsuitable for the FAQ.

Thus, I would like propose:
1) change "DOM" in the entry to "w3c DOM"
2) change the initial definition:
| The Document Object Model (DOM) is a interface-based model for
| Document objects.

to:
| The w3c Document Object Model (DOM) specifications define
| an interface-based model for XML and HTML Document objects
| and Events.

3) change the following:
| Scriptable browsers also have proprietary DOM features (MSDN, MDC),
| such as document.writeln().

to:
| Scriptable browsers have proprietary object models (MSDN, MDC), that
| include many other features (window, screen, document.execCommand).
DOM standards for browsers are defined by the World Wide Web Consortium.
/or/ The World Wide Web Consortium defines DOM standards for browsers.
document.writeln is a DOM 2 standard; thus not proprietary. A
proprietary feature would be document.execCommand.

I propose changing document.writeln to document.execCommand.

[snip]
Does JavaScript always run with a DOCUMENT OM? ISTM that it needs an
OM, but that if JavaScript were used to control a machine (not just a
computer), its chief OM would be application-dependent with relatively
little D about it.
There are three Oms; each has unicode representative.
 
D

Dr J R Stockton

In comp.lang.javascript message <[email protected]
september.org>, Fri, 27 Nov 2009 22:01:25, Garrett Smith
The w3c Document Object Model (DOM) is not part of ECMAScript.

It is a pity that you can neither read nor write English reliably.
The entry does not convey the concept that "The w3c DOM" is not one
specification. It is many specifications (Core, Events, HTML, Style).


DOM stands for "Document Object Model"; In some environments "Document"
would be meaningless (Flash).

Change to "... needs an OM".
It is important to disambiguate between a hazy "w3c DOM" (many specs)
and the general idea of an browser's scriptable object model, which
includes window, screen, and navigator. The term "BOM" (Browser Object
Model) does that, but is not a common term, so seems unsuitable for the
FAQ.

Thus, I would like propose:
1) change "DOM" in the entry to "w3c DOM"

Then you will be changing
The DOM is _not_ part of the ECMAScript programming language.
to
The w3c DOM is _not_ part of the ECMAScript programming language.

That is true, but weak; it suggests that one or more other DOMs may be
part of it. Better to say something like "The ECMAScript standard does
not define a DOM; an implementation of the language will need an
application-dependent OM. For Web browsers, that is the W3C DOM.".

W3C use "W3C, not "w3c". St Luke: Chapter 10, Verse 37, tail.

2) change the initial definition:
| The Document Object Model (DOM) is a interface-based model for
| Document objects.

to:
| The w3c Document Object Model (DOM) specifications define
| an interface-based model for XML and HTML Document objects
| and Events.

3) change the following:
| Scriptable browsers also have proprietary DOM features (MSDN, MDC),
| such as document.writeln().
to:
| Scriptable browsers have proprietary object models (MSDN, MDC), that
| include many other features (window, screen, document.execCommand).

Every acronym in the FAQ needs to be explained, either at first use or
in a glossary. Remember that the target audience includes normal
people.
document.writeln is a DOM 2 standard; thus not proprietary. A
proprietary feature would be document.execCommand.

I propose changing document.writeln to document.execCommand.

Needs a reference to a definition. Google offers 43,700 choices. The
first seems suitable but may not be the best.
[snip]
Does JavaScript always run with a DOCUMENT OM? ISTM that it needs an
OM, but that if JavaScript were used to control a machine (not just a
computer), its chief OM would be application-dependent with relatively
little D about it.
There are three Oms; each has unicode representative.

How do you know that there are three OMs? FAQ 2.3 effectively refers to
at least three (browser, file, nuke); ISTM that JavaScript for a wind
farm and for transport ticketing would require different OMs.

In any case, your response does not address the question - perhaps
"don't know" would have been better,
 
G

Garrett Smith

Dr said:
In comp.lang.javascript message <[email protected]
september.org>, Fri, 27 Nov 2009 22:01:25, Garrett Smith


It is a pity that you can neither read nor write English reliably.

Do you have something worth reading? Snide remarks such as that are a
waste of everyone's time.

[snip]
Change to "... needs an OM".
What is changed from? Better yet, what is the sentence you suggest. It
seems context was lost there.
Then you will be changing

please finish this sentence; I don't understand what you mean.
to
The w3c DOM is _not_ part of the ECMAScript programming language.

That is true, but weak; it suggests that one or more other DOMs may be
part of it. Better to say something like "The ECMAScript standard does
not define a DOM; an implementation of the language will need an
application-dependent OM. For Web browsers, that is the W3C DOM.".

I agree. What you have written is more comprehensive. It switches the
subject from "DOM" to "ECMAScript". As written, it seems more suited for
"What is ECMAScript?".

| As with any OM, the W3C DOM is _not_ part of the ECMAScript
| programming language.

[snip]
Every acronym in the FAQ needs to be explained, either at first use or
in a glossary.

<abbr title="Microsoft Developer Network">MSDN</abbr>

Glossary, at /faq/glossary/, is a good idea for other terms. Along with
section for Functions and updated notes, which I started.

Remember that the target audience includes normal
people.


Needs a reference to a definition. Google offers 43,700 choices. The
first seems suitable but may not be the best.

Scriptable browsers also have proprietary DOM features, such as
document.execCommand (link:MSDN) or window.atob (link:MDC).

[snip]
How do you know that there are three OMs?

You're right; I was mistaken. There are apparently *four* OMs[1]. Thanks
for pointing it out.

Reached a little far, so now having to explain my bad joke.

1) \u0F00
2) \u0950
etc.

I'll have to go over this again tomorrow, when I'm a little more clear
headed.

[1]http://en.wikipedia.org/wiki/Aum
 
J

John G Harris

In comp.lang.javascript message <[email protected]
september.org>, Fri, 27 Nov 2009 22:01:25, Garrett Smith
<[email protected]> posted:


Change to "... needs an OM".
<snip>

"needs" is too strong; it does not have to be an OM. The code needs some
way of interacting with its environment, but there need not be objects
nor a model. The MS Windows API, for instance, uses a collection of
global functions. JScript's FileSystem objects are objects, but do not
model the file store in the way that the HTML DOM models the structure
of the document.

John
 
D

Dr J R Stockton

In comp.lang.javascript message <[email protected]
8924D9443D28E23ED5CD>, Mon, 30 Nov 2009 20:20:50, John G Harris
<snip>

"needs" is too strong; it does not have to be an OM. The code needs some
way of interacting with its environment, but there need not be objects
nor a model. The MS Windows API, for instance, uses a collection of
global functions. JScript's FileSystem objects are objects, but do not
model the file store in the way that the HTML DOM models the structure
of the document.

No : "needs" is correct (the essential point is that, lacking any form
of output, ECMAScript is useless on its own) - but you are saying that
the need may be fulfilled by something which is not actually an OM.

"... needs an external interface, such as an OM/DOM."
^^^^^^^^^^^^^^^^^^ not necessarily optimal wording.
 
D

Dr J R Stockton

In comp.lang.javascript message <[email protected]
september.org>, Mon, 30 Nov 2009 00:30:01, Garrett Smith
Do you have something worth reading? Snide remarks such as that are a
waste of everyone's time.

It is worth pointing out that the FAQ maintainer, although resident in a
country where they think they use English [1], cannot be relied upon to
understand communications written in that language.

please finish this sentence; I don't understand what you mean.

You make comprehension difficulties. You should have read up to the
full stop.

I agree. What you have written is more comprehensive. It switches the
subject from "DOM" to "ECMAScript". As written, it seems more suited
for "What is ECMAScript?".

No. The term DOM is commonly enough used in the newsgroup that it needs
an explanation in the FAQ, findable in the index.

| As with any OM, the W3C DOM is _not_ part of the ECMAScript
| programming language.

[snip]
Every acronym in the FAQ needs to be explained, either at first use
or
in a glossary.

<abbr title="Microsoft Developer Network">MSDN</abbr>

Readers of the FAQ should not be expected to read its source code in
case something is marked with 'abbr', which it currently isn't.
Remember that the FAQ items are published in plaintext News, and need to
be equally usable there

Glossary, at /faq/glossary/, is a good idea for other terms. Along with
section for Functions and updated notes, which I started.

That can be of no use while the FAQ contains no link to it.

If an abbreviation/acronym which is not, with an appropriate meaning, in
a medium-sized printed dictionary of the English language (indeed, since
we have here many who are more fluent in their mother tongue than in
English, a m-s p English-to/from-Foreign dictionary), then, on its first
use in the main part of the FAQ, its expanded form needs also to be
given. The Subject of this thread shoes it being done.

A Glossary should generally be more than an acronym-expander.

How do you know that there are three OMs?

You're right; I was mistaken. There are apparently *four* OMs[1].
Thanks for pointing it out.

Since you cannot know all applications using JavaScript, you cannot know
how many OMs there are; you can only know that there are at least some
number. If you mean only W3C OMs, then say so.


The link "FAQ Notes" on the third line of the FAQ is too inconspicuous.
It should be as big as the level 1 numbered links following. It does
not even look like a link, because the standard link appearance has
foolishly been overridden.


[1] e.g. over there, they have non-rectangular oblongs !
 
G

Garrett Smith

Dr said:
In comp.lang.javascript message <[email protected]
september.org>, Mon, 30 Nov 2009 00:30:01, Garrett Smith
[snip]
<abbr title="Microsoft Developer Network">MSDN</abbr>

Readers of the FAQ should not be expected to read its source code in
case something is marked with 'abbr', which it currently isn't.
Remember that the FAQ items are published in plaintext News, and need to
be equally usable there
The <abbr> elements can be styled so that they have a dotted
border-bottom. That way, when user mouse over the term, the title is
displayed. Screen reader should read the title as well. It's a WCAG p3
guideline.
 
D

Dr J R Stockton

In comp.lang.javascript message <[email protected]
september.org>, Wed, 2 Dec 2009 19:59:10, Garrett Smith
Dr said:
In comp.lang.javascript message <[email protected]
september.org>, Mon, 30 Nov 2009 00:30:01, Garrett Smith
Dr J R Stockton wrote:
In comp.lang.javascript message <[email protected]
september.org>, Fri, 27 Nov 2009 22:01:25, Garrett Smith
<[email protected]> posted:
Dr J R Stockton wrote:
In comp.lang.javascript message <[email protected]
, Thu, 26 Nov 2009 00:00:03, FAQ server <[email protected]>
posted:
[snip]
| Scriptable browsers have proprietary object models (MSDN, MDC), that
| include many other features (window, screen, document.execCommand).
Every acronym in the FAQ needs to be explained, either at first use
or
in a glossary.
<abbr title="Microsoft Developer Network">MSDN</abbr>
Readers of the FAQ should not be expected to read its source code in
case something is marked with 'abbr', which it currently isn't.
Remember that the FAQ items are published in plaintext News, and need to
be equally usable there
The <abbr> elements can be styled so that they have a dotted border-
bottom. That way, when user mouse over the term, the title is
displayed. Screen reader should read the title as well. It's a WCAG p3
guideline.

OK; but that is no help to those reading plaintext.

Standard convention for documents in general is to put both abbreviation
and full version at first use, with one in parentheses. That should be
adhered to, the existence of an alternative notwithstanding. The <abbr>
has the defects that while reading the document one has to fetch the
mouse for elucidation, and that when mousing around the document one
gets distracting titles appearing.
 
T

Thomas 'PointedEars' Lahn

Dr said:
FAQ server posted:

Above : "The" should be "A".

No. "The DOM" refers to whatever DOM implementation it means in the
context of a task, not necessarily one of the W3C DOM.
Since this is a JavaScript FAQ and not a BrowserScript FAQ, that
sentence, which might readily be taken to mean DOM standards for all
purposes, is inappropriate. Remember : JavaScript needs a DOM, and is
not a Web-only language.

DOM standards for browsers are defined by the World Wide Web Consortium.
/or/ The World Wide Web Consortium defines DOM standards for browsers.

No, the W3C DOM specifies a language- and platform-independent API. Start
with looking into the DOM classes in PHP 5, usable client-side and server-
side, which implement these interfaces.


PointedEars
 
D

David Mark

Thomas said:
MSDN (MicroSoft Developer Network) is an acronym¹, not just any
abbreviation. Use the ACRONYM element here instead.

It most assuredly is _not_ an acronym. We've been over this. If it
isn't intended to be pronounced as a word (e.g. radar, STENDEC), it's
not an acronym (it is simply an abbreviation). The question of whether
to use the (largely useless) ABBR element here is a toss-up. The
determining factor should be whether the intended audience will
recognize MSDN for what it is. For instance, we certainly wouldn't need
to bother with HTML or CSS.

Great reading on the subject:-

http://www.cs.tut.fi/~jkorpela/html/abbr.html
 
T

Thomas 'PointedEars' Lahn

David said:
It most assuredly is _not_ an acronym.

I say it is.
We've been over this.

And by contrast to you I have not been posting a reference to a Web site
of some half-wit who is not even a speaker of English as first language,
hardly an authority on the subject. Now you only need to notice that.


PointedEars
 
D

David Mark

Thomas said:
I say it is.

But that doesn't make it so. :)
And by contrast to you I have not been posting a reference to a Web site
of some half-wit who is not even a speaker of English as first language,
hardly an authority on the subject. Now you only need to notice that.

Jukka is quite an authority on HTML IMO. Who cares if he speaks English
as a first language? I found that article insightful and had no problem
understanding his English. Do _you_ speak English as a first language?

And that is beside the point anyway. I meant we had been over the radar
thing, which has nothing to do with Jukka's site. ;)
 
S

Stevo

Thomas said:
I say it is.

PointedEars

How are you pronouncing this alleged acronym? Without any vowels it's
going to be difficult. An acronym is a word and is pronounced as a word,
not a sequence of letters. MSDN is pronounced M S D N with four
syllables and each letter is spoken individually. True acronyms aren't
spelled out letter by letter, they're spoken as words and often aren't
even capitalized anymore.

Examples: Laser, Radar, Sonar, Ram, Rom.
 
T

Thomas 'PointedEars' Lahn

David said:
But that doesn't make it so. :)

True, I am relying here on the professional linguistic experience of
several other people speaking English as first language, and on obvious
etymologic and semantic relationships among Indo-European languages,
including my native one (German). Use the URL I posted and get yourself
informed (especially, consider the references there).
Jukka is quite an authority on HTML IMO.

He has his moments, but that is irrelevant here.
Who cares if he speaks English as a first language? [...]

A person who truly wants to know how the English terms "abbreviation" and
"acronym" can be reasonably defined and might be related to one another,
which would define in turn which one of the two HTML elements, ABBR or
ACRONYM, they should use to mark up certain words. (The HTML 5 WD aside.)


PointedEars
 
J

John G Harris

It most assuredly is _not_ an acronym. We've been over this. If it
isn't intended to be pronounced as a word (e.g. radar, STENDEC), it's
not an acronym (it is simply an abbreviation).
<snip>

According to the online Webster's Dictionary an acronym is something
that can be pronounced, maser, and also something that can't, SPQR. The
Wikipedia article agrees that these two meanings are in common use.

The defining point is that an acronym is built from initial letters,
whereas a mere abbreviation need not be.

John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,709
Latest member
AustinMudi

Latest Threads

Top