Applied Online Programming

Slides:



Advertisements
Similar presentations
Copyright © 2003 Pearson Education, Inc. Slide 8-1 Created by Cheryl M. Hughes, Harvard University Extension School Cambridge, MA The Web Wizards Guide.
Advertisements

1 Extensible Markup Language: XML HTML: portable, widely supported protocol for describing how to format data XML: portable, widely supported protocol.
Dynamic HTML Netscape Navigator (NN) 6.0 & Internet Explorer (IE) 5.0.
Tutorial 16 Working with Dynamic Content and Styles.
1 Extensible Markup Language: XML HTML: portable, widely supported protocol for describing how to format data XML: portable, widely supported protocol.
 2008 Pearson Education, Inc. All rights reserved Document Object Model (DOM): Objects and Collections.
© De Montfort University, Document Object Model Howell Istance School of Computing De Montfort University.
INTRODUCTION TO CLIENT-SIDE WEB PROGRAMMING ACM 511 ACM 262 Course Notes.
The Document Object Model (DOM) & Asynchronous Javascript And XML (AJAX) : an introduction UFCEKG-20-2 : Data, Schemas and Applications.
DHTML. What is DHTML?  DHTML is the combination of several built-in browser features in fourth generation browsers that enable a web page to be more.
1 Fall 2006 Florida Atlantic University Department of Computer Science & Engineering COT 6930 Advanced Internet Programming Dr. Roy Levow Day 2.
HTML DOM.  The HTML DOM defines a standard way for accessing and manipulating HTML documents.  The DOM presents an HTML document as a tree- structure.
JS: Document Object Model (DOM)
 2008 Pearson Education, Inc. All rights reserved Document Object Model (DOM): Objects and Collections.
DOM and JavaScript Aryo Pinandito.
ECA 225 Applied Interactive Programming1 ECA 225 Applied Online Programming DOM.
Creating an Animated Web Page
Working with Objects Creating a Dynamic Web Page.
CITS1231 Web Technologies JavaScript and Document Object Model.
Fall 2006 Florida Atlantic University Department of Computer Science & Engineering COP 4814 – Web Services Dr. Roy Levow Part 4 - XML.
Client side web programming Introduction Jaana Holvikivi, DSc. School of ICT.
JavaScript – The DOM JavaScript is object based The browser is object based – We can access the browser's objects in the same way we did JavaScript's Two.
5.2 DOM (Document Object Model). 2 Motto: To write it, it took three months; to conceive it three minutes; to collect the data in it — all my life. —F.
JavaScript IV ECT 270 Robin Burke. Outline DOM JS document model review W3C DOM.
DHTML: Working with Objects Creating a Dynamic Web Page.
XP Tutorial 16 New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Working with Dynamic Content and Styles Creating a Dynamic Table of Contents.
 2004 Prentice Hall, Inc. All rights reserved. Chapter 13 - Dynamic HTML: Object Model and Collections Outline 13.1 Introduction 13.2 Object Referencing.
INT222 - Internet Fundamentals Shi, Yue (Sunny) Office: T2095 SENECA COLLEGE.
Introduction to Programming the WWW I CMSC Winter 2003 Lecture 10.
1 Dr Alexiei Dingli XML Technologies SAX and DOM.
Internet & World Wide Web How to Program, 5/e. © by Pearson Education, Inc. All Rights Reserved.2 Revised by Dr. T. Tran for CSI3140.
Introduction to the Document Object Model Eugenia Fernandez IUPUI.
Markup basics. Markup languages add commentary to text files –so that the commentary can be ignored if not understood eg HyperText Markup Language –adds.
1 Javascript DOM Peter Atkinson. 2 Objectives Understand the nature and structure of the DOM Add and remove content from the page Access and change element.
 2008 Pearson Education, Inc. All rights reserved Document Object Model (DOM): Objects and Collections.
Review of the DOM Node properties and methods Some ways of accessing nodes Appending, copying and removing nodes Event handling – Inline – Scripting –
Document Object Model. Back to the DOM… Javascript and the DOM  Originally, the Document Object Model (DOM) and Javascript were tightly bound  Each.
ECA 225 Applied Interactive Programming1 ECA 225 Applied Online Programming DHTML Example.
 defined as Extensible Markup Language (XML) is a set of rules for encoding documents  Defines structure and data.
CO1552 – Web Application Development Further JavaScript: Part 1: The Document Object Model Part 2: Functions and Events.
DOM (Document Object Model) - Parsing and Reading HTML and XML -
School of Computing and Information Systems CS 371 Web Application Programming JavaScript - DOM Modifying the Page from within.
Computer Information System Information System California State University Los Angeles Jongwook Woo CIS 461 Web Development I HTML DOM part I Jongwook.
Document Object Model.  The XML DOM (Document Object Model) defines a standard way for accessing and manipulating XML documents.  The DOM presents an.
Create Element, Remove Child. The Document Tree Document Element Root Element Element Element Element Element Text: HelloWorld Attribute “href”
JS: Document Object Model (DOM) DOM stands for Document Object Model, and allows programmers generic access to: DOM stands for Document Object Model, and.
Chapter 10 Dynamic HTML (DHTML) JavaScript, Third Edition.
XML DOM Week 11 Web site:
DOM Dr. Reda Salama. Back to the HTML DOM Once we get a response back from the server, we probably want to update our HTML page The HTML page itself is.
XP Tutorial 10 New Perspectives on JavaScript, Comprehensive 1 Working with Dynamic Content and Styles Creating a Dynamic Table of Contents.
Java Script and the DOM DOM stands for: –The Document Object Model When a browser reads a web page, it converts it’s contents from HTML into a hierarchical.
1 The Document Object Model. 2 Objectives You will be able to: Describe the structure of the W3C Document Object Model, or DOM. Use JavaScript to access.
DHTML.
>> JavaScript: Document Object Model
Scripting the DOM MIS 3502, Fall 2016 Jeremy Shafer Department of MIS
CGS 3066: Web Programming and Design Spring 2017
CS 371 Web Application Programming
Introduction to the Document Object Model
Document Object Model (DOM): Objects and Collections
Week 11 Web site: XML DOM Week 11 Web site:
The Document Object Model
DOM Document Object Model.
Chapter 13 - Dynamic HTML: Object Model and Collections
Introduction to Programming the WWW I
Document Object Model (DOM): Objects and Collections
<p>Sample <b>bold</b> display</p>
Introduction to DHTML, the DOM, JS review
Murach's JavaScript and jQuery (3rd Ed.)
<p>Sample <b>bold</b> display</p>
Presentation transcript:

Applied Online Programming ECA 225 Applied Online Programming W3C DOM ECA 225 Applied Interactive Programming

ECA 225 Applied Interactive Programming DOM Redux DOM hierarchical model of all objects on an HTML page Oct 2000 first standard DOM, DOM1 NN6, IE5 earlier browsers used proprietary DOMs NN4 (layers) IE4 (all) ECA 225 Applied Interactive Programming

ECA 225 Applied Interactive Programming DOM Redux cont … newer browsers Netscape is not backwards compatible with earlier versions of DOM Internet Explorer is backwards compatible with earlier versions of DOM ECA 225 Applied Interactive Programming

ECA 225 Applied Interactive Programming W3C DOM maps all objects found on web page window top of hierarchy document one level down all other objects contained in document relies on object’s id earlier DOMs relied on object’s name ECA 225 Applied Interactive Programming

ECA 225 Applied Interactive Programming W3C DOM cont … document.getElementById( ‘id ’) access attributes of objects document.getElementsByTagName(‘html_tag’) creates an array of all elements on page with a given tag name t = document.getElementById( ‘div1’ ).style.top; li_array = document.getElementsByTagName( ‘li’ ); ECA 225 Applied Interactive Programming

ECA 225 Applied Interactive Programming nodes when a document is loaded into a browser, objects are created in memory W3C DOM provides a model for how all the objects are related W3C DOM refers to objects as nodes ECA 225 Applied Interactive Programming

ECA 225 Applied Interactive Programming node example <p>This is the text node within an element node.</p> this example has 2 nodes: <p> tag is an element node the words between the opening and closing <p> tags is a text node parent-child relationship element node <p> text node This is the text node … ECA 225 Applied Interactive Programming

ECA 225 Applied Interactive Programming node example <p>This is a child node of p. <b>And this is a child node of b.</b></p> <p> is the parent of 2 nodes a text node, “This is a child node of p.” another element node, <b> <b> contains a child node, “And this is a child node of b.” element node <p> text node This is a child node of p. element node <b> text node And this is a child node of b. ECA 225 Applied Interactive Programming

ECA 225 Applied Interactive Programming attribute node <div align='left'> <p>This is a child node of p, which is a child node of div. <b>And this is a child node of b, which is a child node of p.</b></p> </div> element node <div> attribute node align element node <p> text node This is a child node of p ... element node <b> text node And this is a child node of b ... ECA 225 Applied Interactive Programming

ECA 225 Applied Interactive Programming node properties each node has properties that represent its place in the hierarchy parentNode creates a reference to the parent node of the object document.getElementById(‘id’).parentNode; ECA 225 Applied Interactive Programming

ECA 225 Applied Interactive Programming node properties firstChild creates a reference to the first child of the object document.getElementById(‘id’).firstChild; ECA 225 Applied Interactive Programming

ECA 225 Applied Interactive Programming node properties lastChild creates a reference to the last child of the object document.getElementById(‘id’).lastChild; ECA 225 Applied Interactive Programming

ECA 225 Applied Interactive Programming node properties childNodes creates an array of all the children of the object document.getElementById(‘id’).childNodes; ECA 225 Applied Interactive Programming

ECA 225 Applied Interactive Programming node properties nodeValue if the node is a text node, the value is returned document.getElementById(‘id’).firstChild.nodeValue; ECA 225 Applied Interactive Programming

ECA 225 Applied Interactive Programming node properties nodeName returns the name of the node the element name if it is an element node “#text” if it is a test node document.getElementById(‘id’).firstChild.nodeName; ECA 225 Applied Interactive Programming