Information Technology Learning Centers

JavaScript 3

-

Using JavaScript to Manipulate HTML Windows

Prof. Raymond J. Kimball


Project Manager, TechLEAP
Information Technology Institute

Anatomy of a Javascript window object.

Handling a JavaScript window involves the following general procedures, which are then varied depending on the task you want to accomplish:

  1. Define a new function for the window - function = newWindow()
  2. Create a variable with an open window object. catWindow=window.open( )
  3. Define the characteristics of the open window. There's a pattern which the JavaScript looks for in this window.

The anatomy of a JavaScript window object is: window.open('Parameter 1 - content of window', 'winName', 'toolbar=yes,location=yes,scrollbars=yes,width=600,height=400')

The First parameter can be a JPEG, HTML code including a JPEG, or a variable which gets loaded into another part of the code.

  1. Opening a new window using HTML.
  2. Opening a new window using Javascript
  3. JavaScript Window with toolbar, location box, scrollbars, and adjusted width and height.
  4. Georgetown Directions: Opening new windows; and using "onBlur" event handler to close windows.
  5. Loading different contents into a window. Use of the focus method.