Unit 2 — The Exciting World of JavaScript Lesson 8 — Using JavaScript with Frames.

Slides:



Advertisements
Similar presentations
Microsoft Expression Web-Illustrated Unit K: Working with Behaviors.
Advertisements

Working with Forms. how are forms manipulated? the document object contains an array of forms objects, one for each form, in document order –forms[] any.
Chapter 8 Creating Style Sheets.
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.
CIS101 Introduction to Computing Week 08. Agenda Your questions JavaScript text Resume project HTML Project Six This week online Next class.
CIS101 Introduction to Computing Week 12. Agenda Your questions Solutions to practice text Final HTML/JavaScript Project Copy and paste assignment JavaScript:
HTML Markup language - controls appearance and content of a document Javascripts Various HTML tags.
CIS101 Introduction to Computing Week 10 Spring 2004.
CIS101 Introduction to Computing Week 10. Agenda Your questions Final exam and final project CIS101 Student Survey Class presentations: Your Mad Libs.
JavaScript 101 Lesson 5: Introduction to Events. Lesson Topics Event driven programming Events and event handlers The onClick event handler for hyperlinks.
JavaScript Lesson 1 TBE 540. Prerequisites  Before beginning this lesson, the learner must be able to… Create a basic web page using a text editor and/or.
JavaScript, Third Edition
JAVASCRIPT TIPS. REMEMBER JAVASCRIPT IS VERY, VERY CASE SENSITIVE.
CHAPTER 8: Enhancing a Website Session 1. Objectives Embed a YouTube video in your website Insert a slideshow in your website Use Google fonts in your.
Web Programming Material From Greenlaw/Hepp, In-line/On-line: Fundamentals of the Internet and the World Wide Web 1 Introduction The JavaScript Programming.
1 Events Lect 8. 2 Event-driven Pages one popular feature of the Web is its interactive nature e.g., you click on buttons to make windows appear e.g.,
Adding an Inline Style Sheet Page without Inline Style Sheet Page with Inline Style Sheet.
Creating your Webpage with tables. This is a 2 column by 1 row table!
NetTech Solutions Working with Web Elements Lesson 6.
A Power Point Presentation For... A Power Point Presentation ( click to advance slides )
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Tutorial 30 – Bookstore Application: Client Tier Introducing.
1 Lesson 7 Using Images with JavaScript HTML and JavaScript BASICS, 4 th Edition Barksdale / Turner.
Working with background, images and date object Basharat Mahmood, Department of Computer Science, CIIT, Islamabad, Pakistan 1.
Manipulating the DOM CST 200 – JavaScript 3 –
HTML, XHTML, and CSS Chapter 8 Adding Multimedia Content to Web Pages.
Computing Theory: HTML Year 11. Lesson Objective You will: o Be able to define what HTML is - ALL o Be able to write HTML code to create your own web.
Chapter 10 Fireworks: Part II The Web Warrior Guide to Web Design Technologies.
Unit 2 — The Exciting World of JavaScript Lesson 6 — Using Images with JavaScript.
Writing a JavaScript User-Defined Function  A function is JavaScript code written to perform certain tasks repeatedly  Built-in functions.
Enhancing Web Pages  Use Notepad to open any html file  Adding an Animation  Google search ‘free animation’  After saving one, add it to the web page.
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
Introduction to JavaScript 41 Introduction to Programming the WWW I CMSC Winter 2004 Lecture 17.
Tutorial 5 Windows and Frames Section B - Working with Frames and Other Objects Go to Other Objects.
1 Creating Links within a Web Page  These links are especially useful on long Web pages  Links at the top of the page point to areas further down the.
1 Introduction  Extensible Markup Language (XML) –Uses tags to describe the structure of a document –Simplifies the process of sharing information –Extensible.
PHP Form Introduction Getting User Information Text Input.
Input & Output Functions JavaScript is special from other languages because it can accept input and produce output on the basis of that input in the same.
44238: Dynamic Web-site Development Client Side Programming Ian Perry Room:C48 Extension:7287
Handling Image & Animation Using JavaScript HTML tag to display image: More options:
Web Foundations WEDNESDAY, NOVEMBER 20, 2013 LECTURE 32: DREAMWEAVER SLIDE SHOW AND GOOGLE MAP.
Saving PowerPoint Presentations as Web Pages Your Logo Here Open the PowerPoint Presentation. To convert to a format compatible with web browsers, launch.
JavaScript, Fourth Edition Chapter 4 Manipulating the Browser Object Model.
Advanced DOM Builds on last presentation on DOM Allows you to dynamically create elements and position them on a page DOM methods/properties are W3C standard.
Georgia Institute of Technology Creating Classes part 4 Barb Ericson Georgia Institute of Technology May 2006.
CreatingClasses-SlideShow-part41 Creating Classes part 4 Barb Ericson Georgia Institute of Technology Dec 2009.
1 Chapter 3 – JavaScript Outline Introduction Flowcharts Control Structures if Selection Structure if/else Selection Structure while Repetition Structure.
Unit 2, Lesson 7 Creating Web Pages and Web Documents.
Unit 2 — The Exciting World of JavaScript Lesson 7 — Creating Forms with JavaScript.
Advanced DOM Builds on last presentation on DOM Allows you to dynamically create elements and position them on a page DOM methods/properties are W3C standard.
Event Handling (the right way). A Simple Web Page Events - Summary The web page looks like this:
CHAPTER 7 LESSON C Creating Database Reports. Lesson C Objectives  Display image data in a report  Manually create queries and data links  Create summary.
1 Lesson 6 Introducing JavaScript HTML and JavaScript BASICS, 4 th Edition.
McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved. Office Word 2003 Working Together 1 Word 2003 and Your.
JavaScript 101 Lesson 6: Introduction to Functions.
Adding Interactivity Comp 140 Fall Web 2.0 Major change in internet usage –From mostly static pages Text Graphics Simple links –To new paradigm.
Chapter 5 Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc.Slide 1.
Dreamweaver MX. 2 Timeline Overview (p. 480) n Animations can be achieved with DHTML (__________ HTML) using JavaScript code and _____ or later browsers.
COM621: Advanced Interactive Web Development Lecture 6 – JavaScript (cont.)
Unit 2 — The Exciting World of JavaScript
JavaScript Arrays Date
Carrying out a HSE competence assessment in SAPphire: Guidance for Staff This guidance has been prepared to assist staff holding HSE Critical Positions.
Carrying out a HSE competence assessment in SAPphire: Guidance for Staff This guidance has been prepared to assist staff holding HSE Critical Positions.
Javascript: variables and parameters
Event Driven Programming & User Defined Functions
How to Submit Google Docs to the Homework Drop Box
CA203 Presentation Application
JavaScript 101 Lesson 8: Loops.
Registering your returning student at Moody ISD
Presentation transcript:

Unit 2 — The Exciting World of JavaScript Lesson 8 — Using JavaScript with Frames

The Exciting World of JavaScript 2 Objectives Create a JavaScript function with a parameter list. Create JavaScript-enabled hyperlinks that affect frames. Create JavaScript-enabled buttons that affect frames. Create top-level JavaScript functions.

The Exciting World of JavaScript 3 Advanced JavaScript Programming The parent/child concept: In order for a JavaScript function to access an object in a different file, the two files must be linked. The “parent” frame set can be referenced with a JavaScript object. The frame set file defines “child” frames, and these frames are given names. To apply this concept, create a JavaScript-ready frame set.

The Exciting World of JavaScript 4 Advanced JavaScript Programming (cont.) No. 1: Save HTML code necessary to define the parent/child frame set pages. HTML and JavaScript

The Exciting World of JavaScript 5 Advanced JavaScript Programming (cont.) No. 2: Save the HTML page for the upper frame. HTML and JavaScript

The Exciting World of JavaScript 6 Advanced JavaScript Programming (cont.) HTML and JavaScript IMAGE LIST 1: LIONS.GIF 2: TIGERS.GIF 3: BEARS.GIF 4: OHMY.GIF No. 3: Save the HTML page for the lower frame.

The Exciting World of JavaScript 7 Advanced JavaScript Programming (cont.) Display the js-test16.html file, which displays two files. upper1.html lower1.html

The Exciting World of JavaScript 8 Adding JavaScript Code to Your Frame Set No. 1: Change the name of the lower frame file. HTML and JavaScript

The Exciting World of JavaScript 9 Adding JavaScript Code to Your Frame Set (cont.) No. 2: Save a new lower2.html file with a JavaScript function using if statements and the parameter (number) to determine which graphic to use in the upper frame. function setImage(number) { if(number == 1) { parent.upperFrame.document.upperImage.src="lions.gif"; } return; }

The Exciting World of JavaScript 10 Adding JavaScript Code to Your Frame Set (cont.) No. 3: The number is taken from this code, which then passes the name of the requested graphic file to the function. 1: LIONS.GIF 2: TIGERS.GIF 3: BEARS.GIF 4: OHMY.GIF

The Exciting World of JavaScript 11 Adding JavaScript Code to Your Frame Set (cont.) Display the js-test18.html file, which displays two other files. upper1.html lower2.html

The Exciting World of JavaScript 12 Creating a Frame-Based Slide Show No. 1: Change the name of the lower frame file. HTML and JavaScript

The Exciting World of JavaScript 13 Creating a Frame-Based Slide Show (cont.) No. 2: Save a new lower3.html file with new INPUT buttons. WELCOME to my Electronic Slideshow

The Exciting World of JavaScript 14 Creating a Frame-Based Slide Show (cont.) Display the js-test18.html file, which displays two different files. upper1.html lower3.html

The Exciting World of JavaScript 15 Making Your Slide Show Buttons Functional No. 1: Change the name of the lower frame file. HTML and JavaScript

The Exciting World of JavaScript 16 Making Your Slide Show Buttons Functional (cont.) No. 2: Add the JavaScript image array to the new upper2.html. var images= new Array(4); images[0] = new Image; images[0].src = "lions.gif"; images[1] = new Image; images[1].src = "tigers.gif"; images[2] = new Image; images[2].src = "bears.gif"; images[3] = new Image; images[3].src = "ohmy.gif"; var index=0;

The Exciting World of JavaScript 17 Making Your Slide Show Buttons Functional (cont.) No. 3: Add the prevImage() function to upper2.html. function prevImage() { if (index > 0) { index--; document.upperImage.src=images[index].src; } return; }

The Exciting World of JavaScript 18 Making Your Slide Show Buttons Functional (cont.) No. 4: Add the nextImage() function to upper2.html. function nextImage() { if (index <3) { index++; document.upperImage.src=images[index].src; } return; }

The Exciting World of JavaScript 19 Making Your Slide Show Buttons Functional (cont.) No. 5: Rewrite lower4.html with these tags. <INPUT TYPE="BUTTON" VALUE="Prev Image" onClick="parent.upperFrame.prevImage()"> <INPUT TYPE="BUTTON" VALUE="Next Image" onClick="parent.upperFrame.nextImage()">

The Exciting World of JavaScript 20 Making Your Slide Show Buttons Functional (cont.) Display the js-test19.html file, which displays two changed files. upper2.html lower4.html

The Exciting World of JavaScript 21 Creating a Top-Level JavaScript Function No. 1: Add code to the parent file. HTML and JavaScript function message() { alert("We're off to see the Wizard!"); return; }

The Exciting World of JavaScript 22 Creating a Top-Level JavaScript Function (cont.) No. 2: Change the names to the child files.

The Exciting World of JavaScript 23 Creating a Top-Level JavaScript Function (cont.) No. 3: Convert the image hyperlink in the new upper3html. <IMG NAME="upperImage" SRC="lions.gif">

The Exciting World of JavaScript 24 Creating a Top-Level JavaScript Function (cont.) No. 4: Add the new button to the new lower5.html. <INPUT TYPE="BUTTON" VALUE="Show Message" onClick="top.message()">

The Exciting World of JavaScript 25 Creating a Top-Level JavaScript Function (cont.) Display the js-test20.html file, which displays two altered files. upper3.html lower5.html

The Exciting World of JavaScript 26 Summary You can create a JavaScript function with a parameter list. You can create JavaScript-enabled hyperlinks that affect other frames. You can create JavaScript-enabled buttons that affect other frames. You can create top-level JavaScript functions.