index.html—The Frameset

This application has three files: index.html, administer.html, and questions.js. Since index.html is the frameset, let’s start there. Example 2.1 leads the way.

Example 2-1. The index.html Source Code

     1  <HTML>
     2  <HEAD>
     3  <TITLE>JavaScript On-line Test</TITLE>
     4  <SCRIPT LANGUAGE="JavaScript1.1">
     5  <!--
     6  var dummy1 = '<HTML><BODY BGCOLOR=WHITE></BODY></HTML>';
     7  var dummy2 = '<HTML><BODY BGCOLOR=WHITE><FONT FACE=Arial>' + 
     8    'Strap in Bucko: This ain\'t no JavaScript vacation...</BODY></HTML>';
     9  //-->
    10  </SCRIPT>
    11  </HEAD>
    12  <FRAMESET ROWS="90,*" FRAMEBORDER=0 BORDER=0>
    13    <FRAMESET COLS="250,*">
    14      <FRAME SRC="administer.html" SCROLLING=NO>
    15      <FRAME SRC="javascript: self.dummy1">
    16    </FRAMESET>
    17    <FRAME NAME="questions" SRC="javascript: self.dummy2">
    18  </FRAMESET>
    19  </HTML>
The JavaScript flow

Figure 2-6. The JavaScript flow

As you probably noticed, this isn’t your average run-of-the-web frameset y. First of all, it’s nested . That is, a frameset within a frameset. The outer frameset in line 12 defines two rows—the first 90 pixels high, and the second filling the rest of the available window height.

The 90-pixel frame also contains a frameset; this one declares two columns—the first 250 pixels wide and the second filling the remaining available window width. Figure 2.7 shows how the parent window is divided among frames. The SRC attribute of each frame ...

Get JavaScript Application Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.