Short Course in Web Design









STUART MOULTHROP
UNIVERSITY OF BALTIMORE
SCHOOL OF COMMUNICATIONS DESIGN

Most Recent Update 11-27-96

Day Five
FRAMES AND BEYOND


5.1 | FRAMES


5.1.1 · Concept and Background

5.1.2 · Principles of Frame Documents

5.1.3 · FRAMESET and its Attributes

5.1.4 · <FRAME>

5.1.5 · Links and Frames

5.1.6 · Special NAME/TARGET Values

5.1.7 · <NOFRAMES>

5.1.8 · The Trouble(s) with Frames

5.2 | DYNAMIC DOCUMENTS


5.2.1 · The Power of the Dark Side

5.2.2 · <META HTTP-EQUIV>

    The key to dynamic documents is the <META> tag, a solitary structure that goes into the HEAD container of the document; as the name suggests, META provides a way beyond the normal range of HTML function, and in fact META may be used for a number of things besides dynamic documents

    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:

5.2.3 · A Dynamic Document

    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

      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

    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

5.2.4 · Dynamic Documents and Links

    In and of itself, client pull is not especially interesting unless you love slide shows, filmstrips, and the documentaries of Ken Burns

    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

5.2.5 · Dynamic Documents and Frames

    It bears mentioning that client pull may be combined with frames, so that pages can be constructed with elements that automatically transform themselves even as other aspects of the page remain stable; and of course yet more outlandish things are possible

    Follow the link at right for a fairly modest illustration of a frames project with client pull

5.3 | CLIENT-SIDE PROGRAMMING


5.3.1·JavaScript

    JavaScript was originally known as LiveScript, Netscape Communications' concept for a scripting language that would extend the function of Navigator and other Web browsers; but then along came Sun's Java programming language (see next section), and since LiveScript's syntax was largely based on Java (both are based on C), the name was changed

    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:

    • Automatically generate "footer" material for Web pages, including a last-updated notice
    • Run the equivalent of "macros" to automate the formatting of complex documents
    • Open pop-up windows on Web pages
    • Manage a floating navigation palette
    • Implement a "stretch-text" hypertext scheme

    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).

5.3.2·Java

    Java is a programming language invented at Sun Microsystems and meant, though it beggars belief, as a control interface for VCRs, toasters, and other home appliances (imagine having to program your car's engine control system in C++...)

    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

5.3.3·Java in Action

    Here's an embarrassingly simple Java applet:

    Java applets require HotJava, Netscape Navigator 3-series, or similarly equipped browsers.

    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

    As a Web author you may either appropriate existing Java applets, many of which let you change their display content by passing a parameter in the APPLET tag, or you may write and compile your own Java code using a Java developer's environment such as Metrowerks' CodeWarrior, Symantec's Café, Natural Intelligence's Roaster, or the Java Developer's Kit from Sun, currently in beta circulation

    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

    • For the definitive word on Java development, visit Sun Microsystems
    • For the latest and most amazing Java applets, see Gamelan
    • For a few laughs on the newbies, try this

5.4 | BEYOND HTML


5.4.1·Shockwave

    ShockWave is the other huge rock from space that makes old-fashioned Web pages into very doomed dinosaurs; formally speaking, ShockWave is a plug-in for browsers that gives them the capacity to display within Web pages interactive presentations created with Macromedia's Director

    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:

    • Learn Java
    • Learn ShockWave

    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

    And now it's time for the crystal ball... or is it the Magic Eight-Ball? (ANSWER UNCLEAR ASK AGAIN)

    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

      Can the Internet support commerce?
      Does it give us a alternative to transconglomerates and megamarkets?
      Is Internet just the old mass media (TV/radio) revisited?
      A-and where's my cable modem?

In the meantime, remember what Kerouac said:

-- YOU CAN'T STOP THE MACHINE --


END OF NOTES FOR DAY 5

TOP OF THIS PAGE ||| CLASS MAIN PAGE

Last Updated 11-27-96