jschap05 - Chapter 5: Windows and Frames JavaScript -...

Info iconThis preview shows pages 1–18. Sign up to view the full content.

View Full Document Right Arrow Icon
Chapter 5: Windows and Frames JavaScript - Introductory
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Previewing the Virtual Zoo Program
Background image of page 2
Section A: Working with Windows
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Objectives In this section, the students will learn: About the JavaScript object model About the window object How to open and close windows How to work with timeouts and intervals
Background image of page 4
The JavaScript Object Model JavaScript object model is a hierarchy of JavaScript objects, each of which provides programmatic access to a different aspect of an HTML page or Web browser window JavaScript object model is also called the browser object model, client-side object and Navigator object model The Window object represents a Web browser window or an individual frame within a window The Document object descends from a Window object
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
JavaScript Object Model
Background image of page 6
The JavaScript Object Model When using the object name in code, you must always use a lowercase letter, because you are referring to a property To display the value of the text box in an alert dialog box, you must use the statement alert(document.myForm.myTextBox.value); In Internet Explorer, you do not always need to use all of an object’s ancestors It is not always necessary to include the Window object to clearly distinguish between that and the document object Self property refers to the current Window object
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
The Window Object The Window object includes several properties that contain information about Web browser window It also contains various methods that allow you to manipulate the Web browser window itself Navigator and Internet Explorer each have custom properties and methods for the Windows object
Background image of page 8
Window Object Properties
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Window Object Methods
Background image of page 10
Opening and Closing Windows Navigator and Internet Explorer both allow you to open new web browser windows in addition to the web browser or windows that may already be open Several reasons why you may need to open a new web browser window are: Launch a new Web page Use an additional window to display information such as a picture or an order form A new Web browser window is opened, a new Window object is created to represent the new window
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Web Browser Window Opened With a URL Argument of the Open() Method
Background image of page 12
Web Browser Window Opened With the window.open(); Statement
Background image of page 13

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Opening and Closing Windows The name property of a Window object can be used to specify a window as the target in which a URL opens or results of a form submission appear If the name argument of the open() method is already in use by another Web browser window, then JavaScript changes focus to existing Web browser window instead of creating a new one When you open a new Web browser window, customize its appearance using the options argument of the open () method
Background image of page 14
A JavaScript Program That Includes Name and Target Arguments
Background image of page 15

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Common Open () Method Options
Background image of page 16
Opening and Closing Windows If excluding the options string of the open () method , then all normal options will be included in the new Web browser window
Background image of page 17

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 18
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 72

jschap05 - Chapter 5: Windows and Frames JavaScript -...

This preview shows document pages 1 - 18. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online