DOM Level 3 - Example

This section provides a tutorial example of DOM Level 3 objects and attributes. There is no Web browser that supports DOM Level 3 yet.

DOM Level 3 - Published in April, 2004: An API of 21 modules: Core, XML, HTML, XPath, Travesal, Range, Validation, Load and Save, Asynchronous Load, Views, Stylesheets, CSS, CSS2, Events, HTML Events, Mutation Events, Mutation Name Events, UI Events, Mouse Events, Text Events, and Keyboard Events.

Here is a tutorial example of using DOM Level 3 objects and properties:

<html>
<!-- DOM_Level_3_Example.html
   Copyright (c) 2013 by Dr. Herong Yang, herongyang.com
-->
<head>
<title>DOM Level 3 Example</title>
</head>
<body><pre>
<script type="text/javascript">
   document.writeln("\nNew attributes:");
   document.writeln("   document.xmlVersion="+document.xmlVersion);
   document.writeln("   document.inputEncoding="+document.inputEncoding);
   document.writeln("   document.xmlEncoding="+document.xmlEncoding);
   document.writeln("   document.title.textContent="
      +document.title.textContent);

   var feature = document.implementation.getFeature("HTML","3.0");
   document.writeln("\nNew methods:");
   document.writeln("   document.implementation.getFeature()="
      +feature.toString());
</script>
</pre></body>
</html>

I could not test this JavaScript example page, because there is not Web browser that supports DOM Level 3 yet.

Table of Contents

 About This Book

 Introduction to JavaScript

 ECMAScript Language Specification and JavaScript Dialects

 Data Types, Variables and Expressions

 Flow Control Statements

 Creating, Accessing, and Manipulating Arrays

 Defining and Calling Functions

 Web Browser Supporting JavaScript

 Server-Side and Client-Side Web Scripting

 Introduction to Objects

 Defining Your Own Object Types

 Inheritance of Properties and Methods through the Prototype Object Chain

 'jrunscript' - JavaScript Shell Command from JDK

 Using Functions as "Function" Objects

 Introduction to Built-in Object Types

W3C's Document Object Model (DOM) Specifications

 Overview of DOM Specifications

 DOM Level 0 - Example

 DOM Level 1 - Example

 DOM Level 2 - Example

DOM Level 3 - Example

 DOM Level Test - document.implementation.hasFeature

 Inheritance vs. Flattened Views of the API

 A Web Document as A Tree of Different Interfaces

 A Web Document as A Tree of Nodes

 Dump Document in a New Window - JavaScript Source

 Dump Document in a New Window - Firefox 2.0 Result

 Dump Document in a New Window - IE 6.0 Result

 References

 PDF Printing Version