WDMD 170 – UW Stevens Point 1 WDMD 170 Internet Languages eLesson: Working with Windows (No audio component) © Dr. David C. Gibbs 2003-04.

Slides:



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

Tutorial 5 Windows and Frames Section A - Working with Windows.
Samsung Smart TV is a web-based application running on an application engine installed on digital TVs connected to the Internet.
WDMD 170 – UW Stevens Point 1 WDMD 170 Internet Languages eLesson: Decision Making with Control Structures and Statements (non-audio version) © Dr. David.
JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
XP 1 Developing a Basic Web Site Tutorial 2: Web Site Structures & Links.
The Web Warrior Guide to Web Design Technologies
WDMD 170 – UW Stevens Point 1 WDMD 170 Internet Languages eLesson: Working with Forms in JavaScript (there is an audio component to this eLesson) © Dr.
WDMD 170 – UW Stevens Point 1 WDMD 170 Internet Languages eLesson: Using Data Types (No Audio Component) © Dr. David C. Gibbs
Chapter 16 Dynamic HTML and Animation The Web Warrior Guide to Web Design Technologies.
HTML Comprehensive Concepts and Techniques Second Edition Project 8 Integrating JavaScript with HTML.
Javascript Document Object Model. How to use JavaScript  JavaScript can be embedded into your html pages in a couple of ways  in elements in both and.
XP 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties Tutorial 10.
JavaScript 101 Lesson 5: Introduction to Events. Lesson Topics Event driven programming Events and event handlers The onClick event handler for hyperlinks.
JavaScript, Third Edition
WDMD 170 – UW Stevens Point 1 WDMD 170 Internet Languages eLesson: Working with Forms in JavaScript (NON-audio version) © Dr. David C. Gibbs
Copyright © 2004 ProsoftTraining, All Rights Reserved. Lesson 9: Frames © 2007 Prosoft Learning Corporation All rights reserved ITD 110 Web Page Design.
Creating a Console Application with Visual Studio
Working with SharePoint Document Libraries. What are document libraries? Document libraries are collections of files that you can share with team members.
WDMD 170 – UW Stevens Point 1 WDMD 170 Internet Languages eLesson: Data Types and Operators (NON Audio Version) © Dr. David C. Gibbs
Chapter 6: Forms JavaScript - Introductory. Previewing the Product Registration Form.
XP Using Frames in a Web Site Ali Alfayly. XP Tutorial Objectives Create frames for a Web site Control the appearance and placement of frames Control.
Using the Web to Teach & Learn the Web Dr. David C. Gibbs Department of Mathematics and Computing University of Wisconsin-Stevens Point Stevens Point,
XP New Perspectives on Browser and Basics Tutorial 1 1 Browser and Basics Tutorial 1.
Using Visual Basic 6.0 to Create Web-Based Database Applications
Unobtrusive JavaScript
CNIT 133 Interactive Web Pags – JavaScript and AJAX JavaScript Environment.
Hyperlinks. Linking pages…Hyperlinks 2 Lecture 8  Hyperlink “A clickable HTML element that will direct the web browser to display a different Web page.
1 WDMD 170 – UW Stevens Point WDMD 170 Internet Languages eLesson: CSS Introduction to Style Sheets (NON-audio version) © Dr. David C. Gibbs
Creating an Animated Web Page
XP Tutorial 4 New Perspectives on JavaScript, Comprehensive1 Working with Objects Creating an Animated Web Page.
Contents 1 WDMD 170 – UW Stevens Point WDMD 170 Internet Languages e-Lesson: Introduction to WDMD 170 (there is an audio component to this e-Lesson) ©
HTML, XHTML, and CSS Chapter 8 Adding Multimedia Content to Web Pages.
JavaScript, Fourth Edition
Writing a JavaScript User-Defined Function  A function is JavaScript code written to perform certain tasks repeatedly  Built-in functions.
Adobe GoLive Edit and FTP your web pages to a web server.
JavaScript Tutorial 1 - Introduction to JavaScript WDMD 170 – UW Stevens Point 1 WDMD 170 Internet Languages eLesson: Introduction to JavaScript (NON.
Using Client-Side Scripts to Enhance Web Applications 1.
Introduction to JavaScript 41 Introduction to Programming the WWW I CMSC Winter 2004 Lecture 17.
WDMD 170 – UW Stevens Point 1 WDMD 170 Internet Languages eLesson: Decision Making with Control Structures and Statements (non-audio version) © Dr. David.
Tutorial 5 Windows and Frames Section B - Working with Frames and Other Objects Go to Other Objects.
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.
WDMD 170 – UW Stevens Point 1 WDMD 170 Internet Languages eLesson: Variables, Functions and Events (there is an audio component to this eLesson) © Dr.
WDMD 170 – UW Stevens Point 1 WDMD 170 Internet Languages eLesson: HTML/XHTML Tables (NON-audio version) © Dr. David C. Gibbs
JavaScript Tutorial 1 - Introduction to JavaScript WDMD 170 – UW Stevens Point 1 WDMD 170 Internet Languages eLesson: Introduction to JavaScript – A First.
7 Chapter Seven Client-side Scripts. 7 Chapter Objectives Create HTML forms Learn about client-side scripting languages Create a client-side script using.
Topic 7 Temporal Control. 2Chapter 25 - Temporal ControlOutline Goals and Objectives Goals and Objectives Introduction Introduction Timeline Animation.
XP 1 HTML Tutorial 2: Developing a Basic Web Site.
Chapter 2: Variables, Functions, Objects, and Events JavaScript - Introductory.
XP Tutorial 8 Adding Interactivity with ActionScript.
JavaScript, Fourth Edition Chapter 4 Manipulating the Browser Object Model.
WDMD 170 – UW Stevens Point 1 WDMD 170 Internet Languages eLesson: Variables, Functions and Events (NON-Audio version) © Dr. David C. Gibbs WDMD.
Project 5: Using Pop-Up Windows Essentials for Design JavaScript Level One Michael Brooks.
Chapter 27 Getting “Web-ified” (Web Applications) Clearly Visual Basic: Programming with Visual Basic nd Edition.
CISW CRC - Fishman 2014 / 2015 PRESENTATION 4b: CISW 400 (Online) – Client-side Scripting for the Internet Cosumnes River College Fishman – 2015.
Tutorial 11 1 JavaScript Operators and Expressions.
XP Tutorial 8 Adding Interactivity with ActionScript.
Microsoft Office 2008 for Mac – Illustrated Unit D: Getting Started with Safari.
Working with the Window Object JavaScript considers the browser window an object, which it calls the window object.
Adding Javascript How to include javascript in a webpage.
JavaScript and Ajax (JavaScript Functions) Week 5 Web site:
1 Lesson 6 Introducing JavaScript HTML and JavaScript BASICS, 4 th Edition.
1 CSC160 Chapter 1: Introduction to JavaScript Chapter 2: Placing JavaScript in an HTML File.
XP New Perspectives on Macromedia Dreamweaver MX 2004 Tutorial 5 1 Adding Shared Site Elements.
Programming Web Pages with JavaScript
In this session, you will learn to:
Using DHTML to Enhance Web Pages
Project 9 Creating Pop-up Windows, Adding Scrolling Messages, and Validating Forms.
Presentation transcript:

WDMD 170 – UW Stevens Point 1 WDMD 170 Internet Languages eLesson: Working with Windows (No audio component) © Dr. David C. Gibbs

WDMD 170 – UW Stevens Point 2 Tutorial 5 Section A - Working with Windows

WDMD 170 – UW Stevens Point 3 Tutorial 5A Topics Section A - Working with Windows –About the browser object model –About the window object –How to open and close windows –How to work with timeouts and intervals

WDMD 170 – UW Stevens Point 4 The JavaScript Object Model Browser object model –A hierarchy of objects, each of which provides programmatic access to a different aspect of the HTML page or the Web browser window –Created automatically when a Web browser opens an HTML document

WDMD 170 – UW Stevens Point 5 The Jav aSc ript Obj ect Mo del

WDMD 170 – UW Stevens Point 6 The JavaScript Object Model: Window object Represents a Web browser window or an individual frame within a window Top-level object in the browser object model Its properties and methods can be used to control the Web browser window

WDMD 170 – UW Stevens Point 7 The JavaScript Object Model: Document object Represents an HTML document displayed in a window Descended from a Window object Ancestor (parent) for all elements contained on an HTML page –e.g., all HTML elements descend from the Document object

WDMD 170 – UW Stevens Point 8 The JavaScript Object Model: Referencing objects To refer to a JavaScript object in code, you must list all of its ancestors as a series of properties separated by periods (the dot operator) window.document.writeln(“text message”); It is not necessary to explicitly refer to the Window object, it is assumed by the browser document.writeln(“text message”); In some browser versions, it is not necessary to explicitly refer to the Document object

WDMD 170 – UW Stevens Point 9 The Window Object Includes several properties that contain information about the Web browser window e.g., status property –Contains information displayed in a Web browser’s status bar window.status = "This changes the status bar!"; statusBarChanged.htm

WDMD 170 – UW Stevens Point 10 Th e Wi nd o w O bj ec t

WDMD 170 – UW Stevens Point 11 Wind ow Objec t Meth ods

WDMD 170 – UW Stevens Point 12 Opening and Closing Windows Ever wonder how browser windows just “pop-up?” You’re about to see how! NOTE: if you have a pop-up blocker installed on your browser (Google has one) you’ll need to disable it to test your code.Google

WDMD 170 – UW Stevens Point 13 Opening and Closing Windows Netscape and Internet Explorer both allow the opening of new Web Browser windows –Creates a new window object –Use open() method of the Window object –Syntax: window.open(“URL”, “name”, options); window.open(“ opens the browser window shown on the next slide openWindowNoOptions.htm

WDMD 170 – UW Stevens Point 14

WDMD 170 – UW Stevens Point 15

WDMD 170 – UW Stevens Point 16 Opening and Closing Windows When opening a new window, it can be customized using the options argument of the open() method –Multiple items in the options string must be separated by commas –Defaults are provided if no options are specified –If any option is specified, than all desired options must be specified

WDMD 170 – UW Stevens Point 17 Comm on open() method options

WDMD 170 – UW Stevens Point 18 window.open( "Course", "height=300, width=600");

WDMD 170 – UW Stevens Point 19 window.open( "Course", "height=300, width=600, toolbar=yes, scrollbars=yes"); openWindowManyOptions.htm

WDMD 170 – UW Stevens Point 20 Referencing a window A Window object’s name property can only be used to specify a target window with links or forms, and cannot be used in JavaScript code To reference a window in JS code, the new Window object reference must be assigned to a variable var newWindow = window.open( " " );

WDMD 170 – UW Stevens Point 21 Use the file openWindowManyOptions.htm as an example and create a document that opens another window using as many of the window.open options shown in Figure 5-8 as you can.openWindowManyOptions.htm Open the UWSP home page in the window. Save your file as openWindowAlmostAllOptions.htm in your in your Tutorial05 folder. eTask 1

WDMD 170 – UW Stevens Point 22 Refer to the instructions on pages (Gosselin). Create the files PolarBearMain.htm and PolarBear.htm and save them in your Tutorial05 folder. Preview the files. eTask 2

WDMD 170 – UW Stevens Point 23 Working with Timeouts setTimeout() –Used to execute code after a specific amount of time has elapsed –Executes only once –Syntax: variable=setTimeout(“ ",milliseconds); NOTE: above can be a function call for example: polarBearOpened=setTimeout('confirmPolarBear()',10000); After 10 seconds, the confirmPolarBear() function is called.

WDMD 170 – UW Stevens Point 24 Working with Timeouts clearTimeout() Used to cancel a setTimeout() method Syntax: clearTimeout( ); where the variable was assigned the return value of the setTimeout() method. for example, if the time out was set with polarBearOpened=setTimeout('confirmPolarBear()',10000); it can be cleared with clearTimeout(polarBearOpened);

WDMD 170 – UW Stevens Point 25 Working with Intervals setInterval() –Similar to setTimeout() except it repeatedly executes the same code after being called once –Syntax: var variable=setInterval(" ", milliseconds); NOTE: can be a function call

WDMD 170 – UW Stevens Point 26 Working with Intervals clearInterval() –Used to cancel a setInterval() method

WDMD 170 – UW Stevens Point 27 Type in the program shown in Figure on page 245 of Gosselin. Save the file as useSetClearTimeout.htm in your Tutorial05 folder. Preview the file. eTask 3

WDMD 170 – UW Stevens Point 28 Refer to the instructions on page 246 (Gosselin). You will modify the Polar Bear program adding a setTimeout() method. Modify PolarBearMain.htm, saving the new file as PolarBearMainTimeout.htm and save it in your Tutorial05 folder. Preview the files. eTask 4

WDMD 170 – UW Stevens Point 29 Assignment Complete exercises #1-4 on page 250 (Gosselin, Tutorial 05A). Here is a helpful hint for Exercise #2: openWindowShowVariable.htm openWindowShowVariable.htm There is a screen shot of output of Exercise #4 on the next slide. Post your solutions to your Tutorial05 folder CISSRV3 server. Provide links to exercises 3 & 4 in a post to your eReview discussion group. Describe any difficulties and ask any questions you might have in completing those exercises. You may also post any questions (and the exercise file) to the eReview group – for discussion purposes.

WDMD 170 – UW Stevens Point 30 Exercise #4 page 251- output

WDMD 170 – UW Stevens Point 31 End of eLesson Jump to the Beginning of this eLesson WDMD 170 Course Schedule D2L Courseware Site