The DOM, or Document Object Model, defines what objects and functionality are available to scripts. Since the ECMAScript language can be implemented in places other than the browser (server-side, command-line scripts, etc) the DOM is what links the ECMAScript language syntax with the actual browser environment. In most cases, it is a misunderstanding of the DOM that leads to browser incompatabilities and non-working code. There are different versions of the DOM standard, supported to different extents in different browsers. The browsers usually also have additional DOM objects and functionality that are not part of the standards.
These links have notes on browser compatability with the DOM standards.