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:
- Define a new function for the window - function = newWindow()
- Create a variable with an open window object. catWindow=window.open( )
- 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.
- Opening a new window using HTML.
- Opening a new window using Javascript
- JavaScript Window with toolbar, location box, scrollbars, and adjusted width and height.
- Sizing a picture in a new JavaScript Window using a table - Simon Ammann
- Georgetown Directions: Opening new windows;
and using "onBlur" event handler to close windows.
- Loading different contents into a window. Use of the focus method.
- Calculating in a New Window - Beer!