lecture7.pptx - COMM 644 Web Programming Intermediate Zak...

This preview shows page 1 - 7 out of 44 pages.

Copyright © Zak Ruvalcaba COMM 644 Web Programming Intermediate Zak Ruvalcaba Lecture 7 [email protected] Twitter: @zakruvalcaba LinkedIn: linkedin.com/in/zakruvalcaba
Copyright © Zak Ruvalcaba This week at a glance… Introduction to the DOM Introduction to DOM Scripting The DOM Core Specification DOM Core Nodes The Node Interface The Document Interface The Element Interface The Attr Interface DOM HTML and DOM HTML Examples Exercises 1-5 Lab 12: The FAQs Application DOM HTML Examples for Forms and Form Objects Exercises 6-13 Lab 13: The New User Registration Application This week at a glance…
Copyright © Zak Ruvalcaba Introduction to DOM Scripting
Copyright © Zak Ruvalcaba DOM Scripting Introduction to the DOM The DOM is a W3C (World Wide Web Consortium) standard. The W3C provides the DOM to define a standard for accessing documents programmatically: "The W3C Document Object Model (DOM) is a platform and language-neutral interface that allows programs and scripts to dynamically access and update the content, structure, and style of a document." The W3C DOM is separated into three levels, including: DOM Level 1 (Core and HTML) DOM Level 2 (Core, Views, Events, Style, Traversal and Range, and HTML) DOM Level 3 (Core, Load and Save (XML), Validation, Events (Keyboard), and XPath)
Copyright © Zak Ruvalcaba DOM Scripting DOM Level 1 The DOM Level 1 specification is separated into two parts: Core and HTML. Core Level 1 provides a set of interfaces that can represent any structured document, as well as defining interfaces for representing an XML document. HTML Level 1 provides additional interfaces that are used with the interfaces defined in Core Level 1 to provide a more convenient view of an HTML document. These include the Node , Document , Element , Attr , and Text interfaces. All interfaces contain attributes and/or methods that can be used to interact with both XML and HTML documents. This will be the primary focus of this lecture with some exceptions.
Copyright © Zak Ruvalcaba DOM Scripting DOM Level 2 The DOM Level 2 specification contains six different specifications: The DOM2 Core, Views, Events, Style, Traversal and Range, and the DOM2 HTML. DOM2 Core extends the functionality of the DOM1 Core. getElementById() method introduced. DOM2 Views allow programs and scripts to dynamically access and update the content of a representation of a document. DOM2 Events give a generic event system to programs and scripts. Event phases and addEventListener() introduced. Several interfaces make life easier when dealing with events including EventTarget, EventListener, Event, etc. DOM2 Style (DOM2 CSS) allows programs and scripts to dynamically access and update the content of style sheets. DOM2 Traversal and Range allow programs and scripts to dynamically traverse a range of content in a document.

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture