Click here to get back home

DOM CliffsNote

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
DOM CliffsNote Anonymous 03-15-2008
`--> Re: DOM CliffsNote Nikita the Spid...03-16-2008
Posted by Anonymous on March 15, 2008, 1:19 pm
Please log in for more thread options
I spent a day getting to know JavaScript (already know C/C++),
which was not difficult. However, getting my head around the
DOM is another matter. I have been looking for a CliffsNote
version of how the DOM works, and all of the P/M/E's, but so
far all I have found are: long winded specifications (no time),
web pages that are not really focused on my needs, and would
take a lot of effort to print, and come-ons for books. Anyone
know of some good candidates?

While I'm at it, I have a few questions about the DOM for
HTML. Hope someone can help, or direct me to a news group
better suited.

1. My understanding is that the Window is the parent or root
level of the tree. Correct? Most of what I have seen on
the web starts at the document level

2. The Window level has objects regarding the browser history,
browser in use, the current link, etc?

3. Frames are also at the window level, not the document?

Thanks,
Dave
---
e-mail: d boland 9 (all 1 word) at fastmail period fm


Posted by Rik Wasmus on March 15, 2008, 1:36 pm
Please log in for more thread options
> I spent a day getting to know JavaScript (already know C/C++),
> which was not difficult.

Which makes your question more suited to comp.lang.javascript.
Crossposted/f'upped to there.

> However, getting my head around the
> DOM is another matter. I have been looking for a CliffsNote
> version of how the DOM works, and all of the P/M/E's, but so
> far all I have found are: long winded specifications (no time),
> web pages that are not really focused on my needs, and would
> take a lot of effort to print, and come-ons for books. Anyone
> know of some good candidates?
>
> While I'm at it, I have a few questions about the DOM for
> HTML. Hope someone can help, or direct me to a news group
> better suited.
>
> 1. My understanding is that the Window is the parent or root
> level of the tree. Correct? Most of what I have seen on
> the web starts at the document level

Afaik, yes. Usually the 'window.' start can be ommitted though. (Formally
you'd use window.document.someThing, however you can use
document.someThing directly without problems.)

> 2. The Window level has objects regarding the browser history,
> browser in use, the current link, etc?

history: check
current url: check
browser in use: depends, don't rely on it / don't care about it. Heavily
favor checking for (the existance of) needed features instead of sniffinf
browsers.

> 3. Frames are also at the window level, not the document?

Guess so.

Not really helpfull from my side, my javascript is really rusty, but
probably you get a more authorative/complete answer in c.l.javascript.
--
Rik Wasmus

Posted by Ben C on March 15, 2008, 1:40 pm
Please log in for more thread options
> I spent a day getting to know JavaScript (already know C/C++),
> which was not difficult. However, getting my head around the
> DOM is another matter. I have been looking for a CliffsNote
> version of how the DOM works, and all of the P/M/E's, but so
> far all I have found are: long winded specifications (no time),
> web pages that are not really focused on my needs, and would
> take a lot of effort to print, and come-ons for books. Anyone
> know of some good candidates?
>
> While I'm at it, I have a few questions about the DOM for
> HTML. Hope someone can help, or direct me to a news group
> better suited.

comp.lang.javascript is probably better.

> 1. My understanding is that the Window is the parent or root
> level of the tree. Correct? Most of what I have seen on
> the web starts at the document level

The window is the JavaScript "global object", so it's the root of the
tree of objects in your JavaScript program.

But of course not every object in the program is a DOM object.

If you create a global variable in your JS program, like

var foo = 6;

Then that variable is also known as window.foo.

The document object is a member of the window object that kind of gets
put there magically for you, under the name window.document (or you can
just use the name "document").

In C++ terms "window." means the same as "::".

The methods of the document object are the way into the DOM, for
example:

document.write("hello world");
document.getElementById("foo").style.backgroundColor = "yellow";

etc.

> 2. The Window level has objects regarding the browser history,
> browser in use, the current link, etc?

That kind of thing.

> 3. Frames are also at the window level, not the document?

Yes. The thing is there is one scripting context (i.e. global namespace,
global object, window object) per document.

If you've got frames, you've got several different scripting contexts.
They don't share the global variables. But they do have references to
each others' window objects through window.frames. But that's DOM 0 and
not standard...

Better to try comp.lang.javascript, I've set the followup.

Posted by Nikita the Spider on March 16, 2008, 12:24 pm
Please log in for more thread options

> I spent a day getting to know JavaScript (already know C/C++),
> which was not difficult. However, getting my head around the
> DOM is another matter. I have been looking for a CliffsNote
> version of how the DOM works, and all of the P/M/E's, but so
> far all I have found are: long winded specifications (no time),
> web pages that are not really focused on my needs, and would
> take a lot of effort to print, and come-ons for books. Anyone
> know of some good candidates?

Short & sweet:
http://www.visibone.com/javascript/

They also have HTML, CSS and MySQL sheets.

(Not affiliated, just a satisfied customer.)

--
Philip
http://NikitaTheSpider.com/
Whole-site HTML validation, link checking and more


Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap