|
|
STUART MOULTHROP UNIVERSITY OF BALTIMORE SCHOOL OF COMMUNICATIONS DESIGN Most Recent Update 11-27-96 Day Five
|
5.1 | FRAMES
5.1.1 · Concept and Background
In part this development answers the complaint that "travel" in the Web is too disorienting; with frames, part of the screen can remain stable as others change; this stable "ledge" could contain a table of contents, context-sensitive help, or just an identifying mark
Frame pages may thus enclose and exhibit other pages: this effect adds a new dimension to hypertext linking in HTML, allowing destination points to become visible before the reader has departed the original context
Since an entire frame page may be called up as subframe of another such page, the potential for recursion is very high, windows within windows within windows; frames add considerably to the sophistication -- and complexity -- of Web documents
Finally, the cynic's view: perhaps the motivation behind frames is simply commercial: advertisers can now keep their messages in front of Web surfers even as they cruise from site to site
| A GENERALIZED FRAME DOCUMENT |
<HTML> |
A frame document has no BODY container: this is replaced in the markup by the
FRAMESET container; note that no tags useable inside a BODY container
(IMG, H, HR, etc.) may appear ahead of the FRAMESET tag -- the browser will
ignore the frames information if it finds any of these first
Thus frames construction is an all-or-nothing proposition:
you can't mix frames with other layout styles as you can tables, applets, and
other HTML enhancements
By implication, frame layout pages constitute a new class
of HTML documents, a more general and abstract level of structure
that is connected to older forms, yet distinct from them
5.1.3 · FRAMESET and its Attributes
Unlike tables, the frame scheme allows both rows and columns to be specified, so the initial FRAMESET tag has attributes for COLS as well as ROWS
Here is a specimen frames layout showing this principle in action; unlike in previous examples, you'll have to follow a link to see the frames output because the actual frames markup must reside on a separate page
| A Simple Frame Layout | |
<frameset rows="50%,50%"> |
VIEW THE OUTPUT |
In this example the framesets for the various columns (vertical divisions, two above and one below) are nested inside the frameset for the two rows (horizontal divisions)
Nothing requires that rows be specified before columns; we could have nested the elements the other way around, though this produces a different layout, as you can see
In designing a frames layout with both rows and columns, you first define one dimension of the grid (rows or columns) then work out the divisions within each of the primary units; there must be a subordinate FRAMESET container for each of these units, and this container must account for all the local subdivisions or frames
The dimensions of these frames may be set in three ways: in percentages (as in our examples), in absolute pixels, or with an asterisk (*), indicating the frame in question will be sized relatively, i.e. in relation to the space available; consider this tag, for instance:
<FRAMESET ROWS="120,*,55">
The frameset divides the screen horizontally into three zones,
the topmost 120 pixels high, the lowest 55 pixels high, and the middle
zone whatever remains after these values are deducted from the total
height of the active window; this approach might be used to place
non-scrolling "ledges" at top and bottom and a scrolling window in
the middle of the screen
Don't forget the quotation marks ("") around the values assigned to
ROWS and COLS -- though many attributes don't
strictly require quotation marks, ROWS
and COLS absolutely do; if your layout isn't
coming out as you want, check your code for a missing quotation mark
<FRAME> also has optional attributes:
By default they show up in the same frame within which the link was activated, as in this example...
You may however create links that "arrive" in frames other than the one containing the departure point: this is done by adding a TARGET attribute to the departure link anchor
The value assigned to TARGET may be the NAME value assigned in <FRAME>: consider yet another example, along with its frame layout:
| "TABLE OF CONTENTS" FRAME LAYOUT | |
<frameset cols="20%,80%"> |
VIEW OUTPUT |
Each of the two frames in this layout has a NAME attribute (though in this case only the second, "main," is actually used); the links contained in the "toc" ("Table of Contents") frame all contain TARGET attributes referring to "main," for instance:
<a href="demoA.html" target="main">FILE A</a>
By using TARGET in link anchors, you can cause a link to change the contents of a specified frame; note however that links cannot be targeted to more than one frame
NOTE: Special NAME/TARGET values must be given in lowercase letters; though HTML is usually not case-sensitive, this is a crucial exception
5.1.7 · <NOFRAMES>
You can think of NOFRAMES as a sort of emergency BODY container: when redesigning older pages for frames, some authors simply copy all the contents of BODY in the old version and insert it into the NOFRAMES container of the frames layout; or consider this more conservative option:
| EXAMPLE OF "NOFRAMES" BYPASS | ||
| MARKUP | OUTPUT | |
<NOFRAMES> |
| |
5.1.8 · The Trouble(s) with Frames
This was a less than perfect solution, since the "hide frames" link could be scrolled out of sight on longer pages; Netscape responded by adding a feature to the local pop-up menu called New Window With This Frame
It is particularly difficult to view the source of a page within a frames layout; View Source in the browser shows only the markup for the layout page
To find the source for pages within frames, readers can use the New Window feature described above, then view the document source once the page has been isolated.
Though in our experience FRAMEBORDER="NO" has every little effect (the border lines lose detail but don't go away), placing BORDER="0" in the outermost FRAMESET tag will suppress frame lines for the entire page unless they are turned back on in individual FRAME tags.
This is of course as much a blessing as a curse: would I really want a meta-scrollbar on the left or bottom of the screen, allowing me to scroll EVEN MORE frames into view?
But while it seems unwise to promote the spread of frames, remember that scrolling would allow sensible designers to limit the number of frames while increasing their size, oh well...
5.2.1 · The Power of the Dark Side
Dynamic documents represent a dark parody of this idea: automatic and mysterious transformation of data
And that's good! -- document dynamism is yin to hypertext's yang, the tonic of subversive weirdness playing against the generally rational dominant of the Web
Actually, we doubt the fine folks at Netscape had any such thing in mind when they cooked up this idea; they were probably just trying to include constantly updated stock prices and sports scores on Web pages
Hey, LSD was an accident, too...
The key to this application is the HTTP-EQUIV attribute of <META>: if META is a verb that means "act strangely," HTTP-EQUIV is an adverb that says "act like a server" -- this tag causes browsers to do things that normally happen on the other end of the client/server axis, i.e., updating the state of the current Web page
<META HTTP-EQUIV...> can be set up in such a way that a page loads, waits for a certain period, then loads itself again, perhaps reflecting some change in its state (a new stock quote plugged in by a CGI, for instance); or more intriguing, the page may load another Web page altogether... and that page may also be capable of some automatic transition, and so on
These and a few related techniques are sometimes referred to as "client pull," since the browser figuratively "pulls" new content out of the server; consider the following example:
| A CLIENT PULL DEMONSTRATION | |
| Like frames, dynamic documents can't be captured in ordinary Web layouts |
PUSH ME PULL YOU |
This simple parlor trick uses five Web pages, each of which contains either the following META tag or some variant thereof:
<META HTTP-EQUIV="REFRESH" CONTENT="2; URL=DDEX2.HTML">
The server function being imitated here is called REFRESH, which means replace the Web page currently being displayed with another (or with another version of the present page)
The CONTENT attribute contains two items: a time delay in seconds (2)
and the URL for the page that is to be displayed when the two seconds are up --
note that both elements of this attribute are contained
within the same set of quotation marks, separated by a semicolon
-- that is not a typographical error
In the larger scheme of things, each page in this series calls its successor
(DDEX1 calls DDEX2 which calls DDEX3, etc.) until we come to DDEX5,
which after two seconds automatically links to the page you are reading now
If I were setting up this syntax, I would not stuff two very different
values into one attribute; the designers may have been driven
to this by limits on how information may be passed from client to server --
whatever the cause, be very careful of syntax when dealing with the META tag,
because it doesn't obey all the rules
5.2.4 · Dynamic Documents and Links
However, designers of the META tag made its function subordinate to ordinary HTML hypertext links: links override the automatic page-turning machinery -- user actions always take precedence
This raises the possibility of texts that alternate between loops and leaps, between programmatic succession and sudden, willful departures into the unknown; we leave it to you to figure out what might be done with those ingredients
Follow the link at right for a fairly modest illustration of a frames project with client pull
5.3.1·JavaScript
The idea behind JavaScript was originally to provide a "first stage" for Common Gateway Interface scripts on the server and Java applets in the browser; JavaScript was supposed to take care of obscure but important tasks like figuring out if the information entered in an interactive form fits the criteria set out for it, or if the right windows are open to display certain data
Indeed, much of the language as first defined related to the FORMS part of HTML; we haven't said anything about FORMS in these classes because it's our belief that Java will eventually replace CGIs and fill-out forms for many if not most of the current CGI applications
Though the original release of JavaScript (in Netscape Navigator 2.0) was rather limited and in some cases bug-ridden, we have seen it used successfully to do things like:
If you are running Navigator 2.0 or later, you already have JavaScript: the code is integrated into the browser; for more information and basic documentation, see Netscape's home; there are also a few guides to JavaScript available, including a very helpful book by Danny Goodman
The 3-series release of Navigator contains a revamped version of JavaScript with notably expanded functions. It's now possible to use JavaScript to control appearance of page elements and to add interactivity to Web designs. For a good example of this, see the Clinton/Gore page.
Though we were initially skeptical about JavaScript, the language seems to be coming into its own. With the addition of LiveWire, a facility for linking JavaScript to Java applets, lots of intriguing possibilities open up.
Microsoft has its own implementation of JavaScript, called JScript. MS-Explorer 2-series does not support JavaScript, but apparently the 3 and 4-series will (though at this writing, they exist only for Windows).
Java delivers the power of object-oriented languages to the very doorstep of Web authors; Java "applets" (cute little applications) stream in with a Web page, much the same as image files: except that applets are executable programs, like the browser itself, and thus they are capable of doing much more with your PC's resources than even the most animated GIF ever did
The HTML container that introduces applets is called, amazingly, <APPLET>: unlike frames, but like other inclusive structures such as IMG, TABLE, and SCRIPT, the APPLET container fits within the BODY container and is integrated into page layout as an in-line element; here's what the APPLET tag looks like for the example above:
<applet code="fadeout02.class" height="320" width="50">
<table width=75% cellpadding=10 border=1>
<tr><td align=middle>
Java applets require HotJava, Netscape Navigator
3-series, or similarly equipped browsers.
</td></tr></table>
</applet>
The first attribute in the initial tag (CODE) identifies the Java applet to be included here; applets are identified by the ".class" extension; the ".class" file contains binary data representing "bytecodes" which can be translated by interpreters in Navigator and other browsers; bytecodes are a cross-platform lingua franca: with a few small exceptions, they deliver the same results in Mac-OS, Windows, and UNIX
The initial APPLET tag also has attributes for HEIGHT and WIDTH; these set the dimensions of the rectangle in which the applet will execute; there is not as yet any way to make applet windows transparent or run over other parts of the page (though it's simple enough to define a full-screen applet and deliver all your page content via Java)
In addition to HEIGHT and WIDTH, there is an ALIGN attribute, not used here: it functions the same way for applets that it does for images and tables
You'll see a table containing text inside the APPLET container: like the contents of a NOFRAMES tag, this is a backup notice provided for people whose browsers don't support Java; as with frames, you can include a complete markup within the APPLET tag; many authors include a static image of their applet's output (assuming it's chiefly visual) to suggest its effects
5.3.4·Working with Java
We don't have scope here to do Java justice; we can say that it deserves the hype and does mark a major turning point for Internet publishing -- a move away from static, magazine-like "pages," heading toward more dynamic and complex conjunctions of information in virtual space
We'll also note that the recent wave of graphical interface building tools for Java could significantly simplify the task of writing Java applets, bringing some of the ease and flexibility of HyperCard and ToolBook to this task; this could have very significant results
5.4.1·Shockwave
For lots more information about ShockWave and Director, see Macromedia's Web site
Given that Macromedia has recently made very significant advances in data compression, that Director is the acknowledged standard for advanced animation and interactive multimedia, and that Director's programming language, Lingo, is only slightly harder than Java, there are two things you need to do now that you have covered the basics:
Note that the above is an unordered list; your choice of obsessions may depend on your professional objectives: folks interested in high-level media and visuals should probably go with ShockWave, while those whose main interest is interactivity will be happier with Java
5.4.2 · VRML, MOOSpace, Metaverse, Oh My
When I first heard about the World Wide Web about five years ago, I opined that by the late nineties it would be just another obscure, academic hypertext system -- right
So how should I know where the Web will be in another five years? -- though I can say that we're moving away from "paper-based data structures," as our Uncle Buddy calls them, and toward complex, multiply mediated, largely unknown information spaces... somebody cue the "Star Trek" theme
But seriously: while you're guzzling Java and checking in for ShockWave treatments, save some attention for object-oriented virtual environments (commonly called MOOs) and for Virtual Reality Modeling Language (VRML), a 3-D object-description language coming soon to an Internet port near you; I would also watch the evolution of Internet-as-marketplace to see if Wired was wrong when it predicted the Web would lose its financial backing in early 1997
-- YOU CAN'T STOP THE MACHINE --