Understanding the html document object model, Programming Languages

At the core of DHTML is the Document Object Model, or DOM, which represents the HTML or XML of a Web page that is displayed in a browser. The Document Object Model that represents HTML content is referred to as the HTML DOM, and the Document Object Model that represents XML content is referred to as the XML DOM. Throughout this book, you have created Web pages that conform to XHTML. Because XHTML documents are just another type of XML document, you can manipulate them with both the HTML DOM and the XML DOM. But which is preferable?

The W3C formally recommends using the XML DOM instead of the HTML DOM. Nonetheless, it's easier to use the HTML DOM with basic types of DHTML techniques, such as those discussed in this and the next chapter. Keep in mind, however, that you must use the XML DOM when using some advanced JavaScript techniques, such as AJAX, which is discussed in Chapter 12.

Each element on a Web page is represented in the HTML DOM by its own object. The fact that each element is an object makes it possible for a JavaScript program to access individual elements on a Web page and change them individually, without having to reload the page from the server.

Although the individual technologies that make up DHTML have been accepted standards for some time, the implementation of DHTML has evolved slowly. One of the main delays in implementation has to do with the DOM. Earlier versions of Internet Explorer and Navigator included DOMs that were almost completely incompatible with each other. This meant that you needed to write different JavaScript code sections for different browsers. At the time of this writing, Mozillabased Web browsers including Firefox, Internet Explorer 5.0 and higher, and Netscape 6 and higher are all compatible with a standardized version of the DOM, Level 3, that is recommended by the World Wide Web Consortium (W3C).

When it comes to Web page authoring, the most important part of the HTML DOM is the Document object. Through the Document object you can access other objects that represent elements on a Web page. Throughout this book, you have used the HTML DOM to access and manipulate form elements. Similarly, you can use JavaScript to manipulate the images on a Web page through the Image object. The value you assign to an element's name attribute becomes the name of an associated Image object. In order to access an Image object named companyLogo, you must append the image name to the Document object as follows: document.companyLogo. (You will learn how to work with the Image object in the next section.)

Posted Date: 2/26/2013 4:52:26 AM | Location : United States







Related Discussions:- Understanding the html document object model, Assignment Help, Ask Question on Understanding the html document object model, Get Answer, Expert's Help, Understanding the html document object model Discussions

Write discussion on Understanding the html document object model
Your posts are moderated
Related Questions
Difference between java and j2ee programming In the basic form, the phrase java is placed as a selection terminology. On the other hand, the phrase J2EE is placed as a renderin

How to make game in pascal language

Abstraction hierarchy of mechanisms Given  the light-sensitive the motor and resistor,  we could  find  several  ways  of interconnecting them, using bits of ceramic and metal

Write a function lastfirst() that takes a list of strings as a parameter. Each string in the list has the format ''Last, First'' where Last is a last name and First is a first nam

Suppose you have a ?le orase of city and country names, like this: Cluj, Romania Debrecen, Hungary Klagenfurt, Austria Berlin, Germany Szeged, Hungary Budapest, Hungary Lintz, A

Write a function called triple (in a file called 'triple.m'). That takes a single variable x and returns a single variable in which every element of x is multiplied by 3. Make sure

Introduction This assignment builds on your application, produced in Assignment 1, which holds a list of cabins, which can be either read in from a text file or just hard coded

Example :  Solve the following differential equation. y (3)   -  12 y''+48 y' + 64 y = 12 - 32 e -8t + 2 e 4t Solution :    We first require the complementary solution

Create a Money data structure that is made up of amount and currency.  (a) Write a constructor for this data structure   (b)  Create accessors for this data structure (c)

What are the main pros and cons of assembly programming language?