1 Lesson 6 Introducing JavaScript HTML and JavaScript BASICS, 4 th Edition.

Slides:



Advertisements
Similar presentations
Chapter 08: Adding Adding Interactivity Interactivity With With Behaviors Behaviors By Bill Bennett Associate Professor MSJC CIS MVC.
Advertisements

Essentials for Design JavaScript Level One Michael Brooks
1 Lesson 5 Introduction to Cascading Style Sheets HTML and JavaScript BASICS, 4 th Edition Barksdale / Turner.
1 Lesson 9 Using JavaScript with Frames HTML and JavaScript BASICS, 4 th Edition Barksdale / Turner.
The Web Warrior Guide to Web Design Technologies
1 Lesson 10 Using JavaScript with Styles HTML and JavaScript BASICS, 4 th Edition Barksdale / Turner.
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic JavaScript: Introduction to Scripting.
Create slices and hotspots Create links in Web pages Create rollovers from slices Create basic animation Add tweening symbol instances to create animation.
Tutorial 10 Programming with JavaScript
Information Technology Center Hany Abdelwahab Computer Specialist.
CIS101 Introduction to Computing Week 10 Spring 2004.
Computer Science 103 Chapter 4 Advanced JavaScript.
CIS101 Introduction to Computing Week 10. Agenda Your questions Final exam and final project CIS101 Student Survey Class presentations: Your Mad Libs.
Tutorial 8 Designing a Web Site with Frames. XP Objectives Explore the uses of frames in a Web site Create a frameset consisting of rows and columns of.
JavaScript 101 Lesson 5: Introduction to Events. Lesson Topics Event driven programming Events and event handlers The onClick event handler for hyperlinks.
Create a Web Site with Frames
Introduction to scripting
1 Advanced Frame Options Using NORESIZE  By default, users may resize frames unless you specify the NORESIZE attribute in the tag  Examples:
Javascript and the Web Whys and Hows of Javascript.
CNIT 133 Interactive Web Pags – JavaScript and AJAX Event and Event Handling.
WEB DESIGN AND PROGRAMMING Introduction to Javascript.
Database-Driven Web Sites, Second Edition1 Chapter 8 Processing ASP.NET Web Forms and Working With Server Controls.
Server vs Client-side validation. JavaScript JavaScript is an object-based language. JavaScript is based on manipulating objects by modifying an object’s.
CS346 - Javascript 1, 21 Module 1 Introduction to JavaScript CS346.
JavaScript, Fifth Edition Chapter 1 Introduction to JavaScript.
 2003 Prentice Hall, Inc. All rights reserved. CHAPTER 3 JavaScript 1.
McGraw-Hill/Irwin © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Dynamic Action with Macromedia Dreamweaver MX Barry Sosinsky Valda Hilley.
JavaScript Defined DOM (Document Object Model) General Syntax Body vs. Head Variables Math & Logic Selection Functions & Events Loops Animation Getting.
WEEK 3 AND 4 USING CLIENT-SIDE SCRIPTS TO ENHANCE WEB APPLICATIONS.
CNIT 133 Interactive Web Pags – JavaScript and AJAX JavaScript Environment.
JavaScript Part 1.
Database-Driven Web Sites, Second Edition1 Chapter 3 INTRODUCTION TO CLIENT-SIDE SCRIPTS.
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.
1 Lesson 7 Using Images with JavaScript HTML and JavaScript BASICS, 4 th Edition Barksdale / Turner.
Tutorial 8 Designing a Web Site with Frames. XP Objectives Explore the uses of frames in a Web site Create a frameset consisting of rows and columns of.
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.
Creating Links – Lesson 31 Creating Links Lesson 3.
Tutorial 10 Programming with JavaScript
Done by: Hanadi Muhsen1 Tutorial 1.  Learn the history of JavaScript  Create a script element  Write text to a Web page with JavaScript  Understand.
Using Client-Side Scripts to Enhance Web Applications 1.
 2003 Prentice Hall, Inc. All rights reserved. CHAPTER 3 JavaScript 1.
Chapter 5: Windows and Frames
XP Tutorial 6 New Perspectives on JavaScript, Comprehensive1 Working with Windows and Frames Enhancing a Web Site with Interactive Windows.
Tutorial 8 Designing a Web Site with Frames. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Explore the uses of frames.
JavaScript - A Web Script Language Fred Durao
44238: Dynamic Web-site Development Client Side Programming Ian Perry Room:C48 Extension:7287
JavaScript Scripting language What is Scripting ? A scripting language, script language, or extension language is a programming language.
Scott Marino MSMIS Summer Session Web Site Design and Authoring Session 8 Scott Marino.
Chapter 2: Variables, Functions, Objects, and Events JavaScript - Introductory.
XP Tutorial 8 Adding Interactivity with ActionScript.
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
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.
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.
Tutorial 10 Programming with JavaScript. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Learn the history of JavaScript.
Invitation to Computer Science 6 th Edition Chapter 10 The Tower of Babel.
Understanding JavaScript and Coding Essentials Lesson 8.
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
Tutorial 10 Programming with JavaScript. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Learn the history of JavaScript.
JavaScript Events Java 4 Understanding Events Events add interactivity between the web page and the user You can think of an event as a trigger that.
Javascript Basic Concepts Presentation By: Er. Sunny Chanday Lecturer CSE/IT RBIENT.
JavaScript and Ajax (JavaScript Environment) Week 6 Web site:
JavaScript Events. Understanding Events Events add interactivity between the web page and the user Events add interactivity between the web page and the.
Adding Interactivity Comp 140 Fall Web 2.0 Major change in internet usage –From mostly static pages Text Graphics Simple links –To new paradigm.
“Under the hood”: Angry Birds Maze
Section 17.1 Section 17.2 Add an audio file using HTML
WEB PROGRAMMING JavaScript.
JavaScript: Introduction to Scripting
Presentation transcript:

1 Lesson 6 Introducing JavaScript HTML and JavaScript BASICS, 4 th Edition

Lesson 6 22 Objectives Display Web page text with JavaScript. Use HTML formatting tags both in and around JavaScript code. Create conditional statements with JavaScript. Use the JavaScript alert() method. Access the browser status line with JavaScript.

Lesson 6 33 Enhancing Your Web Page The document.write() method simply inserts a string of characters into the standard HTML text stream. function hello() { document.write(" Hello World "); }

Lesson 6 44 Creating Conditional Statements in JavaScript The conditional statement gives programmers the ability to evaluate a specific condition and then perform different actions depending on the results of that evaluation. A keyword is recognized as part of the language definition. A variable is a user-defined name for a memory location whose value can change over time.

Lesson 6 55 Creating Conditional Statements in JavaScript (continued) The JavaScript if statement also supports an optional else clause, which defines the action to take if the specified condition is not true. A JavaScript condition will always consist of two tokens separated by a relational operator. A token can either be a variable name (such as x or count) or a literal constant (such as 10 or “hello”).

Lesson 6 66 Creating Conditional Statements in JavaScript (continued) Relational Operators

Lesson 6 77 Using the JavaScript alert() Method The alert() method allows a JavaScript program to display a special dialog box that notifies the user of an unexpected event or that some sort of user action is required. The window object is considered to be the JavaScript default object, which means it is not necessary to use its name explicitly.

Lesson 6 88 Accessing the Browser Status Line The graphic below shows both a status line and an alert message. Web page viewed with Internet Explorer 8

Lesson 6 99 Making Graphic Images Come Alive A function is a segment of JavaScript code that can be invoked or called. – Methods and functions are the same, except that methods have been defined as part of the objects that make up the JavaScript programming environment. Calling a function from a hyperlink Back

Lesson 6 10 Making Graphic Images Come Alive (continued) Teaching an Image to Roll Over: An image rollover changes the appearance of an image when a visitor moves the mouse pointer over the image. – The onMouseOver event is generated when the mouse pointer is over a particular object. – The onMouseOut event is generated when the user moves the mouse pointer off of the object.

Lesson 6 11 Teaching a Hyperlink to Roll Over A hyperlink rollover is triggered when the user moves the mouse pointer over a hyperlink. – The code for an image rollover and a hyperlink rollover are very similar.

Lesson 6 12 Teaching a Hyperlink to Roll Over (continued) The graphic to the right shows JavaScript events.

Lesson 6 13 Advanced JavaScript Programming Frame-based Web page A Web page that contains a frameset includes a file that defines the frameset and two or more additional files that define the frames within that frameset.

Lesson 6 14 Advanced JavaScript Programming (continued) The frameset file is known as the parent document, and the frame files contained within the frameset are known as child documents.

Lesson 6 15 Adding JavaScript Code to Your Frameset All JavaScript function definitions include a parameter list, which is a list of data items that the function needs to perform its intended action. A function parameter is simply an object or data element that is accessed by an assigned name within the function. A parent object is a reserved word in JavaScript that refers to the parent frameset.

Lesson 6 16 Adding JavaScript Code to Your Frameset (continued) Web page with functional hyperlinks By using the JavaScript function parameter to distinguish one hyperlink from another, it is not necessary to define a function for each hyperlink.