Windows

Unit 19

HTML target

The target attribute in the <a> element is deprecated in strict HTML, but is still commonly used. HTML allows you to open a page in a new window.
HTML does not allow you to control the size and location of the new window. Also, HTML does not allow you to give the window focus. We will need to use JavaScript to do these things.

Open a window

You can open a new window with the open() method, and close it with the close() method. You open the new window from your existing window. You must refer to the object, which represents the new window, if you close it from the old window.

Open a window with open options

You can use options with the open method, to control characteristics of the new window.

Write a page

You can open an empty page, and write the html into the new page.

Center a window in the screen

There is a property in the window object for the screen. We can use it to obtain the characteristics of the screen. This will allow us to center our window in the screen. You can see this in the sample.

Reading assignment

Reading assignments are in the text book, Java Script, A Beginner's Guide, Second Edition, by John Pollock; McGraw Hill / Osborne, ISBN 0-07-222790-7

Read Module 10.

Read section 10.1 - It has good description of window properties.
Read section 10.2 - It has good description of window methods.
In the section "Standard Attributes", Pollard lists supported attributes. Flannagan has a more current list. Flannagan's supported attribute list adds left and top, but omits directories from the list given by Pollard.

Alternate reading assignments are in the text book, Java Script Concepts & Techniques Programming Interactive Web Sites, by Tina Spain McDuffie; Franklin, Beedle & Associates, ISBN 1-887902-45-7

Read Chapter 13 Validating forms.

Lecture notes

Do NOT read the lecture notes before hearing the lecture. If you do, you will find the lecture very boring. Read the lecture notes if you do not attend the lecture, or if you wish to review the material.