Advanced HTML Class Reference Info

H. Marc Lewis — last updated 9-July-1998


Back to introductory class info...


Dynamic documents (Server Push / Client Pull):

Client Pull
Example #1
This page simply reloads every 5 seconds (forever). It would be more interesting if each page included something different (e.g. a random image or different set of links). A stop link is included to prevent infinite looping... The source is available in plain-text form.
Client Pull
Example #2
Three pages load one another in sequence, once every 5 seconds (forever). This could (and sometimes is) used to achieve cheap animation. A stop link is included to prevent infinite looping... The source for one of the HTML documents is available in plain-text form.
Server Push
Example #1
This page automatically reloads 7 times, then stops. It is implemented via a CGI program written in C. You can make this one stop just by clicking your browser's [Back] button.
Server Push
Example #2
Netscape's example page, with a Mozilla animation. Includes the C source used to pull (push?) it off...


HTML tags for creating tables:

Tables are great for displaying tabular data, like tables and charts. Take this Web page, for example. But they are also very useful for general page layout control. With creative use of tables (often using hidden borders) you can force the browser to display the text and images on the screen the way YOU want, instead of the way the browser wants!
<TABLE> Encloses your entire table, and identifies it as such. Documents may contain multiple tables, and tables may be nested within one another.
<CAPTION> Labels a table (or figure).
<TR> Container for a row of table cells defined with the <TH> or <TD> elements.
<TH> Defines a 'header' for a row or column. By default the text in a <TH> is centered (and often made bold as well).
<TD> (table data) Defines a table cell in a row or column.
A good, short description of these tags and their attributes may be found in Netscape's Tables as implemented in Netscape 1.1. It's a bit dated, but still useful.


HTML tags for creating FRAMEs (A Netscape enhancement):

The Frames feature of Netscape Navigator 2.0 (and now Internet Explorer 3.0 too) is a sophisticated page-presentation capability that enables the display of multiple, independently scrollable frames on a single screen, each with its own distinct URL. Frames can point to different URLs as well as be targeted by other URLs — all within the same screen. Developers can incorporate banners, ledges, tables of contents, and display panels into their designs, allowing users to scroll through multiple sites simultaneously, submit database queries in one frame and receive back instant results in another and even freeze regions of the screen in place while the user scrolls through information on a page.
<FRAMESET> Replaces the <BODY> tag, and identifies the individual frames which will make up the document when it is viewed.
<FRAME> Defines a single frame in a <FRAMESET>.
<NOFRAMES> Used to create content viewable by browsers which do not support Netscape's Frames enhancement...


TARGET-ing Windows:

The TARGET attribute gives you some control over where the new page appears when the user clicks on a link in their document. It is not an HTML tag, but can be used within the <A>, <BASE>, <AREA>, and <FORM> tags. The general form is: TARGET="window_name" and the result is that the link will be loaded into a window of the given name. Valid window names start with an alphanumeric character or are one of the 4 magic target names shown below.
<A HREF="url" TARGET="Second"> The new page will appear in the window called "Second", which will be created if it isn't already active and visible.
<BASE TARGET="Second"> Linked-to pages will appear in the window called "Second", which will be created if it isn't already active and visible. This may be overridden by TARGET attributes of individual anchor tags.
<AREA TARGET="Second"> The linked-to page will appear in the window called "Second", which will be created if it isn't already active and visible.
<FORM TARGET="Second"> The form tag normally displays the results of a form submission in the same window the form was submitted from. By adding the TARGET attribute to the form tag, the result of the form submission is instead loaded into the targeted window.
'Magic' target names:

TARGET="_blank"
Causes the link to always be loaded into a new blank (unnamed) window.

TARGET="_self"
Causes the link to always be loaded into the same window the anchor was clicked in. This is useful for overriding a globally assigned <BASE> target.

TARGET="_parent"
Causes the link to be loaded into the immediate <FRAMESET> parent of this document.

TARGET="_top"
Causes the link to be loaded into the full body of the current window. This is useful for breaking out of arbitrarily deep FRAME nesting. See http://www.micapeak.com/mc/addrs/ as an example.


HTML tags for doing FORMs:

FORMs are used to collect data to be passed to a CGI program for processing. The CGI program (usually) then selects or generates a document (an HTML file) and sends it to the browser...
<FORM> Used to delimit a data input form. Multiple forms a allowed, but FORMs may not be nested.
<INPUT> Used to represent a field whose contents may be edited by the user. Input types include: CHECKBOX, HIDDEN, IMAGE, PASSWORD, RADIO, RESET, SUBMIT, and TEXT.
<SELECT> Allows the user to chose one of a set of alternatives described by textual labels.
<OPTION> Allowed only within a <SELECT> element. It represents one choice.
<TEXTAREA> Allows the user to enter more than one line of text (often used in email forms, or for comments on an order form).
I've created two example FORMs:
  • A simple FORM which in turn calls a CGI program written in C. The form collects the URL of a page of interest, and produces a new Web page containing the HTML source form of the specified URL. This would be useful if your browser didn't support viewing the original HTML source, or if the URL of interest produced a FRAMESET which prevented you from seeing the original HTML code.

  • A complex FORM demonstrates all the various elements of a form. It's associated CGI program (whose job is to 'handle' the form) displays the QUERY_STRING which it was sent.


Common Gateway Interface (CGI) stuff

Introduction to CGI NCSA's introduction to the Common Gateway Interface, with links to more detailed information and examples.
A FAQ on CGI A somewhat dated Frequently Asked Questions list on CGI.
CGI Environment Variables A description of the ENVIRONMENT variables set by the server when it executes a CGI program.
"C" CGI Subroutines Tom Boutell's library of C subroutines for doing CGI programming -- these routines greatly simplify the low-level detail programming necessary to do CGI work...
Mooncrow's CGI/PERL Source Page An excellent collection of links to various resources for doing CGI programming (forms, page counters, mail stuff, index building, imagemaps, perl, perl resources, etc.).
Another CGI subroutine library Eugene Kim's library of C subroutines (similar to Boutell's above).
CGI Programming for the MacIntosh Grant Nufield's collection of CGI stuff for the Mac.
Yahoo's take on FORMS What you would get if you went to Yahoo looking for information about FORMS.
MIME Documentation A description of the Multipurpose Internet Mail Extensions (MIME) document types.
I've created two examples of CGI programs written in C.
  • The first is a simple CGI example for which the C source is also available. The example simply echos the environment variables set by the server prior to executing the CGI program.

  • The second is a more complicated (and also useful) example. It allows you to see the HTML source for any document on the Web, even if your browser doesn't support source viewing, or if the page you're looking at has FRAMES. The Perl5 source is available, as is a C version for WindowsNT.
I've also created an example CGI program written in Visual Basic.
  • This program uses a DLL (which I also authored) to parse and decode the parameters passed by the Web server, and to write back to the Web server.

  • A downloadable zip file contains all the parts of this package, although you really only need the VBCGI.DLL component if you're going to write your own cgi-bin program. The package also contains some documentation and an example Visual Basic program which implements a simple cgi-bin program to display the parameters passed from an HTML Form.


Java stuff

Sun Sun's Web site. Here's where you can get the latest distribution of the Java Developer's Kit (it's about 10mb if you get the documentation too).
Gamelan The 'main' (non-Sun) source of Java applets, information, links to sites specializing in Java, news, new stuff, etc. This site uses Netscape's FRAMEs. [Note: In case you were wondering, "Gamelan" is the name of the language spoken on the island of Java]


Author: Marc Lewis (marcl@micapeak.com)