Skip navigation

Tag Archives: notes

To understand these terms clearly, we need to know how JavaScript implemented.

Indeed, a complete JavaScript implementation is made up of three distinct parts

  • The Core (based on ECMAScript spec)
  • The Document Object Model (DOM)
  • The Browser Object Model (BOM)


ECMA-262 describes it like this
“ECMAScript can provide core scripting capabilities for a variety of host environments, and therefore the core scripting language is specified…apart from any particular host environment.”

A Web browser is considered a host environment for ECMAScript, but it is not the only host environment. A list of other host environments listed here.

Apart from DOM and BOM, each browser has its own implementation of the ECMAScript interface.

Document Object Model (DOM)

The Document Object Model (DOM) is an application programming interface (API) for HTML as well as XML.

The DOM maps out an entire page as a document composed of a hierarchy of nodes like a tree structure and using the DOMAPI nodes can be removed, added, and replaced.

DOM level 1 consisted of two modules: the DOM Core, which provided a way to map the structure of an XML-based document to allow for easy access to and manipulation of any part of a document, and the DOM HTML, which extended the DOM Core by adding HTML-specific objects and methods.

DOM Level 2 introduced several new modules of the DOM to deal with new types of interfaces:

  • DOM Views — describes interfaces to keep track of the various views of a document (that is, the document before CSS styling and the document after CSS styling)
  • DOM Events — describes interfaces for events
  • DOM Style — describes interfaces to deal with CSS-based styles
  • DOM Traversal and Range — describes interfaces to traverse and manipulate a document tree

DOM Level 3 further extends the DOM with the introduction of methods to load and save documents in a uniform way (contained in a new module called DOM Load and Save) as well as methods to validate a document (DOM Validation). In Level 3, the DOM Core is extended to support all of XML 1.0, including XML Infoset, XPath, and XML Base.

Note that the DOM is not JavaScript-specific, and indeed has been implemented in numerous other languages. For Web browsers, however, the DOM has been implemented using ECMAScript and now makes up a large part of the JavaScript language.

Other DOMs

  • Scalable Vector Graphics (SVG)
  • Mathematical Markup Language (MathML)
  • Synchronized Multimedia Integration Language (SMIL)

Browser Object Model (BOM)

Browsers feature a Browser Object Model (BOM) that allows access and manipulation of the browser window. Using the BOM, developers can move the window, change text in the status bar, and perform other actions that do not directly relate to the page content.

Because no standards exist for the BOM, each browser has its own implementation.


Unless understood css position, it will make UI designers mad. Here are few points to remember.

  1. The static value is only used for overriding a previously set value. (Most cases)
  2. Elements with position:relative are positioned relative to themselves.
  3. A relatively positioned element remains in the document flow
  4. A relatively positioned element counts as positioned, even if we don’t shift it a single pixel in any direction
  5. What people normally mean by positioning, CSS-P or layers, is elements with position:absolute.
  6. Ironically, absolute positioning is relative. An absolutely positioned element is positioned relative to another element, called the containing block.
  7. The containing block of an absolutely positioned element is its nearest positioned ancestor
  8. Absolutely positioned elements are completely removed from the document flow.

Some useful articles

  • XML stands for eXtensible Markup Language.
  • XML is a W3C Recommendation (10th February 1998)
  • XML is Just Plain Text
  • XML tags are not predefined. You must define your own tags
  • XML Separates Data from HTML
  • XML Simplifies Data Sharing,  Data Transport, Platform Changes
    XML Makes Your Data More Available
  • XML is designed to transport and store data. HTML was designed to display data.
  • XML documents must have a root element
  • An XML element is everything from (including) the element’s start tag to (including) the element’s end tag
  • XML elements must have a closing tag, must be properly nested
  • Use elements for data. Use attributes for information that is not relevant to the data.
  • XML tags are case sensitive
  • XML attribute values must be quoted
  • Any name can be used, no words are reserved.
  • <!– This is a comment –>
  • There are 5 predefined entity references in XML:
    &lt; < less than
    &gt; > greater than
    &amp; & ampersand
    &apos; apostrophe
    &quot; quotation mark
  • White-space is Preserved in XML
  • With XML, errors are not allowed
  • Errors in XML documents will stop your XML applications.
  • XML Elements are Extensible
  • Raw XML files can be viewed in all major browsers.
  • It is possible to use CSS to format an XML document. Formatting XML with CSS is not the most common method. W3C recommend using XSLT instead.
  • XSLT is the recommended style sheet language of XML. XSLT (eXtensible Stylesheet Language Transformations) is far more sophisticated than CSS. XSLT can be used to transform XML into HTML, before it is displayed by a browser
  • W3C supports an XML-based alternative to DTD, called XML Schema