ITSE 1411 Beginning Web
JS BOM windows Chapter 4 Discussion
Discussion
  1. Windows can be divided into multiple frames using frameset. However, frames are obsolete in both XHTML and HTML5
  2. Opening a new Window
    • A new window object is created with a new window is opened.
    • The number of windows allowed open at a time depends on what your system will support.
    • The target attribute was deprecated but it is no longer deprecated in HTML5.
    • Using the target attribute, a new window can be opened in an anchor using
      <a href="someURL" target="windowName">some page</a>
    • To open a window using XHTML by using
      window.open(url to be opened, name assigned to the new window, options allowing customization of the window's appearance, replace value to indicate if the window should go in the history list);
    • All arguments in the open method are optional omitting arguments right to left.
    • Options for customization are listed in Table 4-4 on page 210.
  3. Closing a window
    • The close() method is used to close a window. To close a named window, use
      variableName.close();
    • To close the current window use
      window.close(); or self.close();