Intended Audience

All web developers dealing with JavaScript, HTML, CSS, which are already familiar to the basics of these technologies and like to understand more deeply the DOM and the browsers history and evolution.

Overview

Douglas Crockford speaks about: “Why the browser is a source of pain and incompatibility, and why the DOM is an inconvenient API. What was the web initially, there where no session interactivity, than Java failed as global standard of communication. In 1995 came out the scripted browser as Netscape 2 and than begin the browser war with the invention of the term of dynamic Html, document object mode (DOM) from MiscroSoft. Besides the different servers the sites had the problems more with the browsers, and there was the problem with all the differences. w3c came too late in the process with an attempt to unify everything but It was already too bad …”

He explains: “… the way the browser works (in the case of Netscape), and that Netscape introduced the <script></script> tag. By no means there is extream use of src attribute of the script tag which allows to load a source code from an external file. It is a bad idea you put source code of javascript into your Html. Actually there was language attribute introduced by MicroSoft but it’s deprecated, as well as type is deprecated. It’s a good idea to place <script></script> as low as possible in your html, just before the body close tag, and to place l<ink> to CSS in the head. Alse is good to minify the Js file, which have a huge impact as well as caching also, and finaly reduce the number of script files …”

Finally Crockford says: “… that every node in the document has several pointers, pointing to the parent, the first and last child node, and to its next and previous sibling which are very usefull but not always used. The most useful are first child and next sibling.”

Definitions

  1. DOMThe Document Object Model is a platform- and language-neutral interface that will allow programs and scripts to dynamically access and update the content, structure and style of documents. The document can be further processed and the results of that processing can be incorporated back into the presented page. This is an overview of DOM-related materials here at W3C and around the web.
  2. JavaScript – is a scripting language widely used for client-side web development. It was the originating dialect of the ECMAScript standard.
  3. HTML – an initialism of HyperText Markup Language, is the predominant markup language for Web pages. It provides a means to describe the structure of text-based information in a document—by denoting certain text as links, headings, paragraphs, lists, and so on—and to supplement that text with interactive forms, embedded images, and other objects.

About the author

Douglas Crockford is a JavaScript architect in Yahoo!. See more on wikipedia.

Related posts:

  1. Douglas Crockford – Theory of the DOM (part 2)
  2. Douglas Crockford – Theory of the DOM (part 3)
  3. Douglas Crockford – Ajax Performance
  4. Douglas Crockford – The JavaScript Progamming Language (part 2)
  5. Douglas Crockford – The JavaScript Programming Language (part 3)