Copyright © Terry Felke-Morris Web Development & Design Foundations with HTML5 8 th Edition CHAPTER 14 KEY CONCEPTS 1 Copyright.

Slides:



Advertisements
Similar presentations
17 HTML, Scripting, and Interactivity Section 17.1 Add an audio file using HTML Create a form using HTML Add text boxes using HTML Add radio buttons and.
Advertisements

Chapter 08: Adding Adding Interactivity Interactivity With With Behaviors Behaviors By Bill Bennett Associate Professor MSJC CIS MVC.
Essentials for Design JavaScript Level One Michael Brooks
The Web Warrior Guide to Web Design Technologies
Chapter 7 © 2001 by Addison Wesley Longman, Inc. 1 Chapter 7 Sebesta: Programming the World Wide Web.
HTML Comprehensive Concepts and Techniques Second Edition Project 8 Integrating JavaScript with HTML.
JavaScript Describe common uses of JavaScript in Web pages.
Computer Science 103 Chapter 4 Advanced JavaScript.
JavaScript 101 Lesson 5: Introduction to Events. Lesson Topics Event driven programming Events and event handlers The onClick event handler for hyperlinks.
Web Development & Design Foundations with XHTML Chapter 14 Key Concepts.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 14 Key Concepts 1 Copyright © Terry Felke-Morris.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 14 Key Concepts 1 Copyright © Terry Felke-Morris.
Web Programming Material From Greenlaw/Hepp, In-line/On-line: Fundamentals of the Internet and the World Wide Web 1 Introduction The JavaScript Programming.
CP476 Internet Computing JavaScript and HTML1 1.JavaScript Execution Environment The JavaScript Window object represents the window in which the browser.
Javascript and the Web Whys and Hows of Javascript.
CNIT 133 Interactive Web Pags – JavaScript and AJAX Event and Event Handling.
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.
Introduction to JavaScript Dr. John P. Abraham University of Texas – Pan American.
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.
McGraw-Hill/Irwin © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Dynamic Action with Macromedia Dreamweaver MX Barry Sosinsky Valda Hilley.
Event Handlers CS101 Introduction to Computing. Learning Goals Learn about event handlers Determine how events are useful in JavaScript Discover where.
JavaScript Part 1.
JavaScript 1. What is JavaScript? JavaScript allows web authors to create dynamic pages that react to user interaction. It is an Object-based because.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 14 Key Concepts 1 Copyright © Terry Felke-Morris.
UFCEWT-20-3 Advanced Topics in Web Development Lecture 4 : JavaScript, Browsers & the HTML DOM-API.
Adding User Interactivity – Lesson 51 Adding User Interactivity Lesson 5.
CSS Class 7 Add JavaScript to your page Add event handlers Validate a form Open a new window Hide and show elements Swap images Debug JavaScript.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 2 Key Concepts 1 Copyright © Terry Felke-Morris.
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.
Flash & JavaScript Mariela Hristova October 19, 2004 INF 385E – Fall 2004 – School of Information.
Lesson13. JavaScript JavaScript is an interpreted language, designed to function within a web browser. It can also be used on the server.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
1 JavaScript in Context. Server-Side Programming.
Programming with Java © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 1 McGraw-Hill/Irwin Chapter 14 JavaScript.
An Introduction to JavaScript Summarized from Chapter 6 of “Web Programming: Building Internet Applications”, 3 rd Edition.
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
CO1552 Web Application Development HTML Forms, Events and an introduction to JavaScript.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 7 Key Concepts 1 Copyright © Terry Felke-Morris.
JavaScript - A Web Script Language Fred Durao
JavaScript, jQuery, and Mashups Incorporating JavaScript, jQuery, and other Mashups into existing pages.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 9 Key Concepts 1 Copyright © Terry Felke-Morris.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
Scott Marino MSMIS Summer Session Web Site Design and Authoring Session 8 Scott Marino.
Sahar Mosleh California State University San MarcosPage 1 JavaScript Basic.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 2 Key Concepts 1 Copyright © Terry Felke-Morris.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
Web Development & Design Foundations with XHTML Chapter 11 Key Concepts.
1 CSC160 Chapter 7: Events and Event Handlers. 2 Outline Event and event handlers onClick event handler onMouseOver event handler onMouseOut event handler.
HTML Overview Part 5 – JavaScript 1. Scripts 2  Scripts are used to add dynamic content to a web page.  Scripts consist of a list of commands that execute.
Event Handling. Objectives Using event handlers Simulating events Using event-related methods.
Project 8: Reacting to Events Essentials for Design JavaScript Level One Michael Brooks.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 14 Key Concepts 1 Copyright © Terry Felke-Morris.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 2- part 2 Key Concepts 1 Copyright © Terry Felke-Morris.
Document Object Model Nasrullah. DOM When a page is loaded,browser creates a Document Object Model of the Page.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 2 Key Concepts 1 Copyright © Terry Felke-Morris.
JavaScript and Ajax (JavaScript Environment) Week 6 Web site:
Using DHTML to Enhance Web Pages
Web Development & Design Foundations with HTML5
Parts of Chapter 14 Key Concepts
Intro to JavaScript CS 1150 Spring 2017.
Section 17.1 Section 17.2 Add an audio file using HTML
Web Development & Design Foundations with HTML5 7th Edition
Web Development & Design Foundations with HTML5 7th Edition
14 A Brief Look at JavaScript and jQuery.
Integrating JavaScript and HTML
Introduction to JavaScript
Web Development & Design Foundations with H T M L 5
Presentation transcript:

Copyright © Terry Felke-Morris Web Development & Design Foundations with HTML5 8 th Edition CHAPTER 14 KEY CONCEPTS 1 Copyright © Terry Felke-Morris

Copyright © Terry Felke-Morris What is JavaScript? Object-based scripting language Works with the objects associated with a Web page document ◦the window ◦the document ◦the elements ◦such as forms, images, hyperlinks, etc. 2

Copyright © Terry Felke-Morris What is JavaScript? Originally developed by Netscape ◦ Named LiveScript Netscape & Sun Microsystems Collaboration ◦LiveScript renamed JavaScript JavaScript is NOT Java 3

Copyright © Terry Felke-Morris Common Uses of JavaScript Display a message box Select list navigation Edit and validate form information Create a new window with a specified size and screen position Image Rollovers Status Messages Display Current Date Calculations 4

Copyright © Terry Felke-Morris Coding JavaScript JavaScript statements can be coded on a web page using two different techniques: ◦Place JavaScript code between tags ◦Place JavaScript code as part of an event attached to an HTML element 5

Copyright © Terry Felke-Morris JavaScript: Using the script Element The script element ◦ A container tag ◦ May be placed in either the head or the body section of a web page <!- - alert("Welcome to Our Site"); // - -> 6

Copyright © Terry Felke-Morris Hands-on practice 14.1 Page chapter14/14.1/alert.html 7

Copyright © Terry Felke-Morris Document Object Model (DOM) A portion of the DOM is shown at the left. Defines every object and element on a web page Hierarchical structure Accesses page elements and apply styles to page elements 8

Copyright © Terry Felke-Morris Object An object is a thing or entity. ◦Browser window ◦Submit button ◦Web page document 9

Copyright © Terry Felke-Morris Property A property is a characteristic or attribute of an object. ◦The background color of a web page document document.bgcolor ◦The date the web page file was last modified document.lastmodified ◦The src file of an image object image1.src 10

Copyright © Terry Felke-Morris Method A method is an action (a verb) ◦Writing text to a web page document document.write() ◦Submitting a form form1.submit() 11

Copyright © Terry Felke-Morris Hands-on practice 14.2 Page 580 chapter14/14.2/write.html 12

Copyright © Terry Felke-Morris JavaScript and Events Events: actions taken by the web page visitor ◦ clicking (onclick), ◦ placing the mouse on an element (onmouseover), ◦ removing the mouse from an element (onmouseout), ◦ loading the page (onload), ◦ unloading the page (onunload), etc. 13

Events EventEvent Handler clickonclick loadonload mouseoveronmouseover mouseoutonmouseout submitonsubmit unloadonunload 14

Copyright © Terry Felke-Morris Hands-on practice 14.3 Pages chapter14/mouseovertest.html 15

Copyright © Terry Felke-Morris JavaScript and Events JavaScript can be configured to perform actions when events occur. ◦The event name is coded as an attribute of an HTML tag ◦The value of the event attribute contains the JavaScript code Example: Display an alert box when the mouse is placed over a hyperlink. 16 Home

Copyright © Terry Felke-Morris JavaScript Debugging(1) Check the syntax of the statements ◦ Pay very close attention to upper and lower case letters, spaces, and quotations Verify that you have saved the page with your most recent changes Verify that you are testing the most recent version of the page (refresh or reload the page) If you get an error message, use the error messages that are displayed by the browser ◦ In Firefox: Select Tools > Error Console 17

Copyright © Terry Felke-Morris JavaScript Debugging(2) Using the Firefox browser: ◦Select the top right menu icon (“Hamburger” icon) ◦Select Developer > Web Console ◦The Web Console will indicate an issue and the line number ◦This may not be exactly where the problem is ◦Sometimes the error is one or two lines above the indicated line number. 18