1. Basic Syntax
This includes the definition of:
- how to define your variables
- how to perform calculations on those variables
- how to set up loops and functions and
- how to define objects
What this standard doesn’t define is how the script should interface with the web page and the browser.
2. The Document Object Model
The DOM0 'standards' are those methods that the browsers implemented prior to the W3C starting on writing the standards and which the browsers still support today.
The W3C has released three different sets of standards for interfacing with the web page each of which includes everything in the prior standard and which then adds further ways of interfacing with the page. These are known as DOM1, DOM2, and DOM3.
The DOM3 standard is considered to be the final version with no further additions to it being required. Most browsers currently support most or all of the DOM2 standard and small parts of the DOM3 standard. Internet Explorer is somewhat behind the other browsers and still has some gaps in its support for DOM2 although JScript does also provide some alternatives that provide similar functionality.
3. The Browser Object Model
The third and final component is the Browser Object Model which is how the scripts obtain information from the browser and pass information back to it.
For this part of the language there is no one actually co ordinating standards and so the browser writers can define their own interface. Most browsers other than Internet Explorer have copied the Firefox way of interfacing to the browser which simplifies the task somewhat.
Internet Explorer has two different ways of interfacing with the browser depending on whether the browser is being run in standards mode or quirks mode. This is determined by whether the page has a valid DOCTYPE statement as the first tag in the HTML file. Since quirks mode results in web pages looking different in different browsers you should always include a doctype as the first thing in your HTML. That will make it simpler to write code that provides equivalent processing for each browser.