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
You are required to develop a program that calculates the charges for DVD rentals, where current release cost RM3.50 and all others cost RM2.50. If a customer rents several DVDs, e

Expertsmind brings you unique solution in java assignments Event Delegation Model The Delegation Model with java assignment help Version 1.1 of the Java TM foundation

Dynamic Binding: - Binding refers to the linking of a procedure call to the code to be executed in response to the call. Dynamic binding (late binding) means that the code associa

Define the Parameter Passing Mechanism - Computer Programming? The Parameters are syntactically identifiers and they are used within the body of the function and sometimes the

How to run java program?

* Comments in your code are required * Main Program Operation:  # Your program should first prompt the user for an integer to seed the random number Generator. "Enter an seed

Expertsmind brings you unique solution in java assignments Interfaces A program in the Java selection language is a fuzzy type that is used to specify a program (in the ge

Explain the applet Element ? Applets are embedded in web pages by using the and tags. The APPLET element is same to the IMG element. Like IMG APPLET references a source fil

What are Attributes in HTML langauge? A few tags have attributes. An attribute is a name, followed through an = sign, followed by the value. For instance, to make a centered H1

Educational Objectives: After completing this assignment, the student should be able to accomplish the following: Apply generic algorithms in solving programming problems Define an