Tutorial 13 Working with Objects and Styles. XP Objectives Learn about objects and the document object model Reference documents objects by ID, name,

Slides:



Advertisements
Similar presentations
The Document Object Model (DOM) 1 JavaScript is an object-based language—that is, it’s based on manipulating objects by changing each object’s properties.
Advertisements

JavaScript Objects - DOM CST 200 JavaScript. Objectives Introduce JavaScript objects Introduce Document Object Model Introduce window object Introduce.
Tutorial 6 Creating a Web Form
Working with Special Effects Creating Rollovers, Menus, Filters, and Transitions.
HTML 5 and CSS 3, Illustrated Complete Unit L: Programming Web Pages with JavaScript.
The Web Warrior Guide to Web Design Technologies
Tutorial 16 Working with Dynamic Content and Styles.
Tutorial 6 Working with Web Forms
Tutorial 14 Working with Forms and Regular Expressions.
Chapter 9 Introduction to the Document Object Model (DOM) JavaScript, Third Edition.
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic DHTML.
CST JavaScript Validating Form Data with JavaScript.
DHTML - Introduction Introduction to DHTML, the DOM, JS review.
XP Tutorial 14 New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Working with Forms and Regular Expressions Validating a Web Form with JavaScript.
JavaScript and The Document Object Model MMIS 656 Web Design Technologies Acknowledgements: 1.Notes from David Shrader, NSU GSCIS 2.Some material adapted.
Server vs Client-side validation. JavaScript JavaScript is an object-based language. JavaScript is based on manipulating objects by modifying an object’s.
Tutorial 14 Working with Forms and Regular Expressions.
 2004 Prentice Hall, Inc. All rights reserved. Chapter 13 - Dynamic HTML: Object Model and Collections Outline 13.1 Introduction 13.2 Object Referencing.
SEG3210 DHTML Tutorial. DHTML DHTML is a combination of technologies used to create dynamic and interactive Web sites. –HTML - For creating text and image.
WEEK 3 AND 4 USING CLIENT-SIDE SCRIPTS TO ENHANCE WEB APPLICATIONS.
CNIT 133 Interactive Web Pags – JavaScript and AJAX JavaScript Environment.
CS 215 Web Oriented Programming Review Dr. Orland Hoeber orland
DHTML Positioning and Layout. What is DHTML? HTML and xHTML CSS JavaScript or VBScript.
SEG3210 DHTML Tutorial. DHTML DHTML is a combination of technologies used to create dynamic and interactive Web sites. –HTML - For creating text and image.
Creating an Animated Web Page
Working with Objects Creating a Dynamic Web Page.
CITS1231 Web Technologies JavaScript and Document Object Model.
XP Tutorial 4 New Perspectives on JavaScript, Comprehensive1 Working with Objects Creating an Animated Web Page.
Advanced DHTML.
JavaScript, Fourth Edition
Tutorial 10 Programming with JavaScript
Using Client-Side Scripts to Enhance Web Applications 1.
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
Javascript II DOM & JSON. In an effort to create increasingly interactive experiences on the web, programmers wanted access to the functionality of browsers.
XP Tutorial 12 New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Working with Special Effects Creating Rollovers, Menus, Filters, and Transitions.
DHTML - Introduction Chapter Introduction to DHTML, the DOM, JS review.
DHTML: Working with Objects Creating a Dynamic Web Page.
Chapter 7: DHTML: Object Model and Collections CIS 275—Web Application Development for Business I.
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.
การสคริปท์ฝั่งลูกข่ายด้วย JavaScript การเขียนโปรแกรมเว็บ.
JQuery JavaScript is a powerful language but it is not always easy to work with. jQuery is a JavaScript library that helps with: – HTML document traversal.
TOPIC II Dynamic HTML Prepared by: Nimcan Cabd Cali.
XP Tutorial 5 New Perspectives on JavaScript, Comprehensive1 Working with Special Effects Creating Rollovers, Menus, Filters, and Transitions.
Understanding JavaScript and Coding Essentials Lesson 8.
Document Object Model Nasrullah. DOM When a page is loaded,browser creates a Document Object Model of the Page.
XP Tutorial 7 New Perspectives on JavaScript, Comprehensive 1 Working with Forms and Regular Expressions Validating a Web Form with JavaScript.
Lesson 30: JavaScript and DHTML Fundamentals. Objectives Define and contrast client-side and server-side technologies used to create dynamic content for.
Project 5: Customizing User Content Essentials for Design JavaScript Level Two Michael Brooks.
Chapter 6 Murach's JavaScript and jQuery, C6© 2012, Mike Murach & Associates, Inc.Slide 1.
Introduction to JavaScript MIS 3502, Spring 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 2/2/2016.
Project 7: Exploring DHTML Essentials for Design JavaScript Level Two Michael Brooks.
Chapter 10 Dynamic HTML (DHTML) JavaScript, Third Edition.
Tutorial 6 Creating a Web Form
HTML Tutorial. What is HTML HTML is a markup language for describing web documents (web pages) HTML documents are described by HTML tags Each HTML tag.
XP Tutorial 10 New Perspectives on JavaScript, Comprehensive 1 Working with Dynamic Content and Styles Creating a Dynamic Table of Contents.
Chapter 13: DHTML: Object Model and Collections CIS 275—Web Application Development for Business I.
Javascript and Dynamic Web Pages: Client Side Processing
Programming Web Pages with JavaScript
Using DHTML to Enhance Web Pages
CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr
Week 4: Introduction to Javascript
Web Development & Design Foundations with HTML5 7th Edition
CT Web Development, Colorado State University
Chapter 13 - Dynamic HTML: Object Model and Collections
Working with the Event Model
Working with Dynamic Content and Styles
Introduction to DHTML, the DOM, JS review
JavaScript.
Presentation transcript:

Tutorial 13 Working with Objects and Styles

XP Objectives Learn about objects and the document object model Reference documents objects by ID, name, and tag name Work with object collections Work with object properties and CSS styles Study the syntax of object methods Apply an event handler to an object New Perspectives on HTML, XHTML, and Dynamic HTML, 4e2

XP Objectives Work with mouse events Employ object detection to avoid programming errors Create an animation with timed functions Explore how to create sliding and tabbed menus Retrieve values from a style sheet Create custom objects New Perspectives on HTML, XHTML, and Dynamic HTML, 4e3

XP Introducing Pull-Down Menus In a pull-down menu, a menu title is always visible to the user, identifying the entries in the menu New Perspectives on HTML, XHTML, and Dynamic HTML, 4e4

XP Introducing Objects, Properties, Methods, and Events JavaScript is an object-based language – Based on manipulating objects through the use of properties, methods, and events JavaScript supports three types of objects – Built-in objects – Document objects – Customized objects New Perspectives on HTML, XHTML, and Dynamic HTML, 4e5

XP Exploring the Document Object Model The organized structure of objects is called the document object model (DOM) – Goal is to make every object related to the document or to the Web browser accessible to a scripting language New Perspectives on HTML, XHTML, and Dynamic HTML, 4e6

XP Exploring the Document Object Model Each document object model organizes objects into a hierarchy known as a document tree New Perspectives on HTML, XHTML, and Dynamic HTML, 4e7

XP Referencing Objects Each object is identified by an object name To indicate the location of an object within the hierarchy, you separate each level using a dot – Dot syntax New Perspectives on HTML, XHTML, and Dynamic HTML, 4e8

XP Referencing Objects Object collections are arrays consisting of more than one of the same type of object New Perspectives on HTML, XHTML, and Dynamic HTML, 4e9

XP Referencing Objects To reference an object as part of the collection in a document, use either collection[idref] or collection.idref To reference a document object based on its ID, use: document.getElementById(id) To reference an array of elements based on the tag name, use: object.getElementsByTagName(tag) To reference an array of elements based on the value of the name attribute, use: document.getElementsByName(name) New Perspectives on HTML, XHTML, and Dynamic HTML, 4e10

XP Working with Object Properties Most objects are associated with one or more properties – object.property To set the value of an object property, use: object.property = expression To apply a CSS style to a document object, use: object.style.attribute = expression New Perspectives on HTML, XHTML, and Dynamic HTML, 4e11

XP Exploring Object Methods The syntax for applying a method to an object is object.method(parameters) New Perspectives on HTML, XHTML, and Dynamic HTML, 4e12

XP Working with Event Handlers All objects can be affected by events initiated by the user or browser New Perspectives on HTML, XHTML, and Dynamic HTML, 4e13

XP Programming a Pull-Down Menu The this keyword references the currently active object in the Web browser New Perspectives on HTML, XHTML, and Dynamic HTML, 4e14

XP Animating a Pull-Down Menu Create the illusion of a menu being pulled down New Perspectives on HTML, XHTML, and Dynamic HTML, 4e15

XP Animating a Pull-Down Menu New Perspectives on HTML, XHTML, and Dynamic HTML, 4e16

XP Creating Other Types of Menus In a pop-up menu, a user clicks an object on the page and the menu appears, sometimes elsewhere on the page In a sliding menu, a menu is partially hidden either off the Web page or behind another object New Perspectives on HTML, XHTML, and Dynamic HTML, 4e17

XP Creating Other Types of Menus In a tabbed menu, several menus are stacked on the page with one part of each menu visible to the user New Perspectives on HTML, XHTML, and Dynamic HTML, 4e18

XP Exploring Custom Objects Specific objects are referred to as instances of the object, while the general object itself is the object class – var thisDate = new Date(); An object constructor is a function that defines the properties of a whole class of objects New Perspectives on HTML, XHTML, and Dynamic HTML, 4e19