DHTML - Introduction Chapter 11-13 Introduction to DHTML, the DOM, JS review.

Slides:



Advertisements
Similar presentations
Essentials for Design JavaScript Level One Michael Brooks
Advertisements

JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
The Web Warrior Guide to Web Design Technologies
Languages for Dynamic Web Documents
Server-Side vs. Client-Side Scripting Languages
HTML and Web Page Design Presented by Frank H. Osborne, Ph. D. © 2005 ID 2950 Technology and the Young Child.
Chapter 16 Dynamic HTML and Animation The Web Warrior Guide to Web Design Technologies.
 2008 Pearson Education, Inc. All rights reserved Document Object Model (DOM): Objects and Collections.
Web Page Behavior IS 373—Web Standards Todd Will.
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.
DHTML - Introduction Introduction to DHTML, the DOM, JS review.
Chapter 4 Dreamweaver: Part II The Web Warrior Guide to Web Design Technologies.
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.
INTRODUCTION TO DHTML. TOPICS TO BE DISCUSSED……….  Introduction Introduction  UsesUses  ComponentsComponents  Difference between HTML and DHTMLDifference.
JavaScript, Fifth Edition Chapter 1 Introduction to JavaScript.
 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.
CNIT 133 Interactive Web Pags – JavaScript and AJAX JavaScript Environment.
10 Adding Interactivity to a Web Site Section 10.1 Define scripting Summarize interactivity design guidelines Identify scripting languages Compare common.
Lecture 11 – DOM Scripting SFDV3011 – Advanced Web Development Reference: 1.
ECA 225 Applied Interactive Programming1 ECA 225 Applied Online Programming DOM.
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.
Section 17.1 Add an audio file using HTML Create a form using HTML Add text boxes using HTML Add radio buttons and check boxes using HTML Add a pull-down.
Lesson13. JavaScript JavaScript is an interpreted language, designed to function within a web browser. It can also be used on the server.
JavaScript, Fourth Edition
INTRODUCTION TO JAVASCRIPT AND DOM Internet Engineering Spring 2012.
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
Interactive Client-Side Technologies MMIS 656 Web Design Technologies Acknowledgements: Estrella, S. (2003). The Web Wizard’s Guide to DHTML and CSS.
DHTML: Working with Objects Creating a Dynamic Web Page.
Introduction to Programming the WWW I CMSC Summer 2003 Lecture 7.
Building Rich Web Applications with Ajax Linda Dailey Paulson IEEE – Computer, October 05 (Vol.38, No.10) Presented by Jingming Zhang.
Chapter 8 © 2001 by Addison Wesley Longman, Inc. 1 Chapter 8 Sebesta: Programming the World Wide Web.
Chapter 7: DHTML: Object Model and Collections CIS 275—Web Application Development for Business I.
 2004 Prentice Hall, Inc. All rights reserved. Chapter 13 - Dynamic HTML: Object Model and Collections Outline 13.1 Introduction 13.2 Object Referencing.
Introduction to the Document Object Model DOM *Understand document structure manipulation *Dynamic effects in web pages *Programming, scripting, web content.
Cs332a_chapt10.ppt CS332A Advanced HTML Programming DHTML Dynamic Hypertext Markup Language A term describing a series of technologies Not a stand-a-lone.
CSS1 Dynamic HTML Objects, Collections & Events. CSS2 Introduction Dynamic HTML treats HTML elements as objects. Element’s parameters can be treated as.
ECA 225 Applied Interactive Programming1 ECA 225 Applied Online Programming DHTML Example.
TOPIC II Dynamic HTML Prepared by: Nimcan Cabd Cali.
INTRODUCTORY Tutorial 5 Using CSS for Layout and Printing.
Document Object Model Nasrullah. DOM When a page is loaded,browser creates a Document Object Model of the Page.
Lesson 30: JavaScript and DHTML Fundamentals. Objectives Define and contrast client-side and server-side technologies used to create dynamic content for.
The Web Wizard’s Guide To DHTML and CSS Chapter 2 A Review of CSS2 and JavaScript.
Web Technology (NCS-504) Prepared By Mr. Abhishek Kesharwani Assistant Professor,UCER Naini,Allahabad.
Project 7: Exploring DHTML Essentials for Design JavaScript Level Two Michael Brooks.
Chapter 10 Dynamic HTML (DHTML) JavaScript, Third Edition.
The Web Wizard’s Guide To DHTML and CSS Chapter 2 A Review of CSS2 and JavaScript.
Chapter 6 © 2003 by Addison-Wesley, Inc Introduction - Dynamic HTML is not a new markup language - A dynamic HTML document is one whose tag attributes,
Chapter 13: DHTML: Object Model and Collections CIS 275—Web Application Development for Business I.
CIS 375—Web App Dev II DHTML. 2 Introduction to DHTML _________ HTML is “a term used by some vendors to describe the combination of HTML, style sheets.
6.1 Introduction 6.2 Element Positioning
Introduction to.
DHTML.
Using DHTML to Enhance Web Pages
CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr
JavaScript Event Handling.
JAVASCRIPTS AND HTML DOCUMENTS
4. Javascript Pemrograman Web I Program Studi Teknik Informatika
JavaScript Introduction
DHTML Javascript Internet Technology.
Chapter 13 - Dynamic HTML: Object Model and Collections
DHTML Javascript Internet Technology.
Introduction to DHTML, the DOM, JS review
Presentation transcript:

DHTML - Introduction Chapter Introduction to DHTML, the DOM, JS review

What is DHTML? Dynamic HTML are web pages which can interact with the user. DHTML uses web pages created with CSS and a scripting language to make changes to the pages. This technology is the marriage of existing components: CSS+JavaScript+DOM+XHTML=DHTML

DHTML attempts to overcome limitations of Web pages designed with common HTML. The resulting pages act and react to a user without continually returning to the server for more data. All of the code for the site is placed on the client-side.

DHTML does not require plug-ins In most cases, it works across many browsers. Be wary of Microsoft's ActiveX version of DHTML. It helps to enhance the interactivity and visual appeal of the page.

Browser Specific DHTML uses the Document Object Model as the basis for changing the appearance. –window.document.img.freddy – You need to check on the version of the DOM which the browser implements. Old Netscape-based tested for document.layers Old IE tested for document.all (see DHTML demo on schedule) You may need to check the user’s browser before allowing the DHTML to continue, but not if you use standards-based DHTML: Key to that getElementById() getElementsByTagName()

Advantages Support by most browsers Small file size No plug-ins Easy to learn Fast development Faster Web experience No Java programming required

Disadvantages Browser and OS incompatibilities Picky coding of scripting language and CSS Buggy Browsers

An Alternative Flash –It is consistent –It is ubiquitous (requires a plug-in) –Attractive and small BUT

Flash –Can be difficult to learn and create –Has a plug-in phobia –Has extensive usability which requires great responsibility on the part of the designer. Leads to a lack of standard Web conventions. –May not be small—requiring extensive downloads

So—which to use Need to consider –Audience’s technology –Money budgeted for the project –Need for sound, animation or other media Usually Flash –Presentation of large amounts of text Usually DHTML –Development and maintenance time DHTML is usually faster to create –Audience’s expectations

Document Object Model – the DOM Address through which you locate objects on the HTML page and send it a message. Can be referenced and changed through JavaScript. Most objects in a page have names and/or ids.: –getElementById() window.document.img.fredddy –

Create an object in CSS Define a style in the stylesheet with the id #name { } When you wish to reference the object in the body of the document, use the id attribute on the tag and give it the name you defined in the stylesheet.

Now you may use event handlers for the HTML tag, to cause changes in the HTML object. You may reference the object by using the name you defined in the id attribute. The attribute will ONLY change when the event occurs. If there are multiple events you wish to execute on the same event-handler, you need to separate the events by semicolons.

Events Recall that JavaScript acts through –event + object = (re)action Events are things like "user moves mouse over image" Event handlers are the XHTML attributes for that action – See list on schedule page

Getting elements Recall that an element is content. In addition to getElementById() You will see getElementsByTagName (note it's plural) used in combination with the getAttribute() method. Methods are pre-existing JavaScript functions

Let’s look at some of the code to get an element and move it. Chapter 12.4

Passing events Event detection varies by browser –evt object is understood by IE –window.event object is W3C standard Note that Teague says he normally uses getElementById plus event handlers

Feature sensing See if browser understands a method such as innerHeight –if {window.innerHeight) {do something} Also used to go to another page in non- standard DOM: –if (!document.getElementById) { window.location = " }

Some things to detect Browser detection is alternate to feature detection Note that browser object is navigator –navigator.userAgent Finding Screen Dimension Finding the number of colors Finding Browser Window’s Dimensions Finding the Visible Page Dimensions Finding the Page’s Location and Title Finding the Page’s Scroll Position

Finding an Object’s Dimensions Finding an Object’s Top and Left Positions Finding an Object’s Right and Bottom Positions Finding an Object’s 3-D position Finding an Object’s Visibility State Finding an Object’s Visible Area (clip settings)

Skim chapters 14, 15 to learn what else can be detected –position –z-index –event properties (event.type)