The DOM and Dynamic HTML
Due to the basic DOM of older browsers, JavaScript could only have a limited effect on a page. There were certain elements, such as forms and images, that you could control with JavaScript, but if you wanted to do something more complexsuch as adding or removing several paragraphs, making a form appear out of nowhere, or displaying data dynamically within textyou were out of luck.
To escape this limitation, browser manufacturers created Dynamic HTML, or DHTMLan extended DOM that allowed JavaScript to manipulate more of a page. Unfortunately, this was still limitingyou had to work with certain defined parts of the page called layers rather than having complete control over the page.
Worse yet, Microsoft and Netscape created completely different and incompatible versions of DHTML, which led to some complicated and unreliable scripting.
Fortunately, you won't have to learn about those incompatible versions of DHTML because the W3C DOM has made them unnecessary. Although browsers still aren't perfectly interchangeable, today's browsers support enough of the standard DOM to enable you to fully control the content of pages without much concern over browser issues. In this hour and the next hour, you'll create several examples of DOM scripts that will work fine in all modern browsers.
By the Way
There are still browser issues, of course. Hour 15, "Unobtrusive Scripting," will show you how to deal with browser differences and how to minimize your chances of running into problems with new browsers.
|