BODY: anchor, graphics, tables, newtlets, client image maps, frames

This document describes the following BODY tags:

A

indicates a hyperlink Anchor. Several attributes are possible; for now, we just document (and implement) NAME and HREF. You can combine NAME and HREF in the same A expression.

Attributes: REL, REV, TITLE (not implemented); NAME, HREF

NAME

names a destination ("head anchor") for a hyperlink. This has no visible effect. We typically add these to headings. For example, a later section's heading is defined as: <H3><A NAME="HR">HR</A></H3>

Notes: the first HR is the value (name) for this anchor (it can be different from the visible heading itself; case sensitive?). the second HR is the string which appears in this heading. You can apply A to text elements and to graphics (IMG). This now works with nested phrase markup.

Newt's Cape generally ignores empty strings in tags, so to name a place in the document, you should include some non-whitespace in the named range. Note: if a range is empty, Newt's Cape now inserts an special space, i.e., &nbsp;; however, this is still not ideal since this space may appear at beginning of a paragraph, or create an invisible paragraph just before a heading (at end of previous page if Above='top). If you're creating your own HTML, it's still much better to use a non-empty range, within context of a block (e.g., paragraph or heading) tag.

Also, if you see strange results (especially with HREF), be sure to check that you aren't missing " or </A>. Note: Newt's Cape currently associates only a single name with an object, so if multiple names are specified, only the last will be used (and later found).

HREF

sets a destination for a hyperlink. When user taps the phrase (typically underlined), browser follows (or executes) the link. Usually, a destination consists of a document and possible named object within the document. For a relative file reference or absolute http: URL, Newt's Cape checks the "book cache" (i.e., saved book package in Extras) for a book that matches the filename (isbn) and full URL (book's BASE) -- if so, the book is opened. For NIE, Newt's Cape next checks the HTML source cache. Finally, Newt's Cape requests the URL via NIE or WebMail.

Notes: ' also recognized as URL delimiter. HREF="javascript:..." recognized but ignored.

For NOS 2.x (with NIE), Newt's Cape requests the URL from a server via TCP -- this file may be another HTML document, or a .gif or .pkg file (or another MIME type if the appropriate helper app is installed).

For 1.x (or no NIE or using a mailto: Proxy), Newt's Cape posts an email message to the Outbox addressed to a WebMail server. After you send this message using your email client, e.g., Aloha, you will receive an HTML source document in your Inbox that you can access directly from Newt's Cape. It is possible that large documents may be truncated or split. This is not real-time -- the delay depends on your email system and its internet gateway.

HR

adds a horizontal divider line.

Example: <HR>

Result:


ALIGN (not yet supported)

SIZE

specifies the height (in pixels) of the divider (default: 2)

WIDTH

specifies the width of the bar in pixels or as percentage (default: current container)

NOSHADE

a unary attribute. If present, divider is black; otherwise, it is dark gray (default).

IMG

adds an image or icon. Currently, Newt's Cape does not do any fancy layout, e.g., in-line graphics -- use a table instead for horizontal layout. Should work within P, A, TD (table); other uses are less predictable. Large pictures automatically display a 2D scroll compass at lower left. If you would prefer to scale pictures to fit screen or table cells, use Scale to Fit option -- it does not scale 1.x PICT or any animated PICTs. If graphic is not present, Newt's Cape displays ALT text, or your IMG: no ALT preference, or a "?" icon; horizontal gesture popups up a menu of commands.

SRC

specifies the URI of the image resource. For NIE, this would the internet address of a .gif or .jpeg file. On the Newton, this could be a bitmap or PICT-format data object from ROM or a resource soup; if you use a single level of directory, this maps to the soupname, and the filename to a graphic object with that name or title slot in the soup, e.g., "bitmaps/nwscpicn.gif". See general description of graphic conversion/transfer and URL interpretation/shadowing. Graphics can be converted via NCGC and transferred via Sloup, or created locally with editors such as HexPaint. You can also include animated GIFs and other pictures (examples).

ALT

text to use in place of image if not available or skipped by user preference. Not required, but highly recommended.

ALIGN

Possible values: LEFT, RIGHT, CENTER (supported, except for image maps); TOP, MIDDLE, BOTTOM (unsupported).

ISMAP

indicates an image map. Normally used to indicate a server-side image map; Newt's Cape adds ?x,y to URL request (so that coordinates will work properly, ALIGN is ignored; and scaling may occur). For client-side image maps, use MAP and AREA.

Example: <IMG SRC="bitmaps/nwscpicn.gif" ALT="Newt's Cape Icon">

Result: Newt's Cape Icon

You can use documented built-in, i.e., ROM icons. For further information, see advanced NewtonScript info.

Example:<IMG SRC="inboxIcon"ALT="Inbox">

Result: Inbox

You can include animated graphics (GIFs or built-in).

Example:<IMG SRC="arrows"ALT="rotating arrows">

Result: rotating arrows

USEMAP

reference to a MAP object

WIDTH

width of image in pixels (defaults to width of current container -- screen or table cell)

HEIGHT

height of image in pixels (defaults to height of image itself). If image does not fit on current book page, it appears at top of next page.

Other attributes: BORDER, HSPACE, VSPACE (unsupported).

MAP

MAP supports client-side image maps via a series of AREA tags: each associates a region with an HREF. Starting with version 1.4, you can define several IMG objects, before or after the corresponding MAP and AREA tags.

NAME

The name attribute provides a local reference for an earlier USEMAP in an IMG. For example,

<IMG...USEMAP="#foo1">
<MAP NAME="foo1">

AREA

AREA occurs inside MAP and defines a rectangle, circle or polygon region of a graphic image. Attributes:

SHAPE
rect, circle, poly/polygon
COORDS
coordinates are relative to upper left (y increases toward bottom). Ideally, there should be commas (rather than a space) between elements. A poly normally ends with the same initial point.
rect
left,top,right,bottom
circle
centerx,centery,diameter
poly
x1,y1,x2,y2,...x1,y1 (note: closed)
HREF
URL
NOHREF
unary attribute to create a "hole" with no client (or server) action. currently ignored (just don't specify HREF)
ALT
text to appear if no graphic present

Several examples (using ROM graphics/sound):

mapplay9.htm
play some sounds for 0-9
mapworld.htm
display name of continent

TABLE

Contains table entries. Examples in intro and later. If a table has a large fixed width greater than screen size, Newt's Cape attempts to scale each column (rather than just clip rightmost columns as in earlier versions). For best results in your own documents, use percentages or smaller (or no) widths.

Current limitations: nested tables do not format properly -- they are flattened into one table: rows with mixed height graphics (or radio buttons?) may not split properly, borders may not line up. If a table has very strange layout, with very narrow columns, or information that is otherwise not visible, you may want to turn on the Ignore Tables preference, Remove the Current Book, and reprocess the same URL.

CAPTION

Typically used for a table title.

Attributes: ALIGN(top,bottom) -- not implemented; BORDER (=0 to omit borders; =1 for a border (larger values default to 1), though for multiple items or certain objects there may be gaps; best to turn off if you have INPUT objects).

TR

delimits a Table Row. </TR> optional? Newt's Cape uses the first row to define the number of columns and column width. Other rows with less than that number of columns will be padded. Newt's Cape generally uses equal column widths (unless cells specify a WIDTH attribute) and does not split rows across page boundaries.

TH

A Table Heading, typically occurs in cells in first row and/or first column. </TH> optional? Attributes:

COLSPAN
(default=1). Currently, cells with COLSPAN=0 are skipped.
ALIGN
(default=CENTER)
ROWSPAN
(default=1) is not supported, except in a limited way for only the first column -- entire cell contents are still displayed in first row, but Newt's Cape should add a dummy column to appropriate number of later rows; this still assumes that first row contains maximum number of columns for table.
WIDTH
percentage or fixed number of pixels. total width should not exceed 100% or width of screen. pages with large fixed widths may be clipped or strange if there is right alignment. default cell widths default to first row (those default to equal parts of remaining width)
NOWRAP
unary. recognized but not implemented

TD

Table Data can contain text, phrase markup, IMG, and some FORM objects (INPUT, SELECT). Attributes: COLSPAN (default=1), ALIGN (default=LEFT), ROWSPAN (see TH note), WIDTH (see TH note). Newt's Cape should support empty cells, multiple items in a cell and headings (though gaps may occur if there are borders). </TD> optional?

<TABLE BORDER>
<CAPTION>Example: A test table</CAPTION>
<TR><TH>Head1
<TH COLSPAN=2>Head2 and Head3</TH>
<TH>Head4</TH><TH>Head5</TR>
<TR><TD>first
<TD>long text, next cols missing
<TR><TD><I>some italic</I>
<TD><B>some bold</B>
<TD><A HREF="#TABLE">a link</A>
<TD><I>some</I> <B>mixed</B>
<TD>E=mc<SUP>2</SUP>
<TR><TD COLSPAN=2>a straddle
<TD>a picture (next)
<TD><IMG SRC="inboxIcon" ALT="Inbox">
<TD>the end</TABLE>

Result:

Result: A test table
Head1Head2 and Head3Head4Head5
firstlong text, next cols missing
some italicsome bolda linksome mixedE=mc2
a straddle. example with many features: table with animated graphics using "NewtonScript URLs" to play a sound or stop/start animationsa picture (next) Inbox

APPLET

While Java support is not yet available on the Newton, you can embed NewtonScript packages now directly in your page. We call these "newtlets". You could, of course, already run an application by tapping on its URL, i.e., appSymbol. But a newtlet appears in a reserved space on the page; you can also download the newtlet directly from the net if you don't have it installed. It automatically opens (with initialization PARAMeters) and closes, as you open/close the book or scroll the page. (Of course, such pages will not work properly on the desktop). newtlets.htm example shows use of built-in apps (e.g., stylePalette and alarm), and a user app (e.g., Lee Moon's Doggie). Attributes:

CODEBASE
(required) base URL (directory path) for the newtlet. ends in /
CODE
(required) file URL (file name) for the newtlet. full path is CODEBASE plus this
WIDTH
(required) width of newtlet in pixels
HEIGHT
(required) height of newtlet in pixels
NAME
(required) name of the applet. for the Newton, this is the "appSymbol" in GetRoot() [this is an app, not autopart, currently]
ALT
(recommended) string to tell user what's there, esp. on non-Newtons
ALIGN
(optional) [not implemented] TOP,MIDDLE,BOTTOM,LEFT,RIGHT
HSPACE
(optional) [default: 0] reserved space around the newtlet. this should be the border width (viewFormat.vfPen)
VSPACE
(optional) [default: 0] reserved space around the newtlet. this should be the border height (viewFormat.vfPen) [I need to add this to book spacing]

For example:

<H1>Doggie page</H1>
<P>here is a newtlet -- Lee Moon's Doggie.

<APPLET CODEBASE= "http://communicrossings.com/html/newton/newtscape/exs/" CODE="Doggie.pkg"
WIDTH=55 HEIGHT=53 HSPACE=1 VSPACE=1 NAME="Doggie:LeeMoon"
ALT="tap on this to run or download Doggie">
<PARAM NAME="delay" VALUE="100"> <!-- speedup animation -->
</APPLET>

Further info/assumptions about Newtlets:

PARAM

PARAM tag occurs inside APPLET to provide initialization parameters for a newtlet. Note: these are copied to the application object before opening, but they can also be provided via the :openNewtlet API.

PARAM attributes (kinda like META):

NAME
name of a slot to set in the newtlet
VALUE
value of slot. (this string is an expression, which is compiled and evaluated)

FRAMESET, FRAME, NOFRAMES

Newt's Cape has several levels of support for frames, but frames do not appear or behave exactly as in a desktop browser. As a default, frames appear as just links from the main document to separate documents, rather than as nested tables. Later, you can temporarily (or permanently) append individual frames to the main document. Once you are comfortable with how Newt's Cape deals with frames, you can make the process automatic, but this is not the default, due to the complexities of frames on some sites.

Note: some servers with built-in (incorrect) client tables, i.e., no entry for "Newt's Cape", may return pages with "your browser does not support frames". If you really want the frame versions of pages, you might try changing your Agent Prefix to masquerade as a desktop browser that's known to be frames compatible.

As the default, Newt's Cape creates a link in the main document to each FRAME URL -- normally this is displayed as H1 tag (for navigation via overview TOC):

for uncached frames
?FRAME: NAME (attribute) -- ? analogous to missing graphic
for cached frames
FRAME: TITLE (document)
.

You can use the map FRAME to tag preference to change which tag is used for this, and indirectly the appearance of these added links. Newt's Cape displays the NOFRAMES (or NOFRAME) section, if any. You can tap on a link to go to a separate FRAME document.

You can load an individual FRAME document by tapping on its link, or a group of frames manually by using View:Load Frames, or automatically by turning on the autoload frames preference on the HTML Cache.

Once individual frames are loaded, you can leave them as individual documents (still accessible via links), or include them temporarily in the main document book, or include and merge them permanently into the main document source.

If you enable Include Frames, Newt's Cape automatically appends the separate documents into the current main document, and skips the NOFRAMES section; if relative links in the to-be-included frame document are from a different server or directory from the main document, its URLs are "fixed" in the cached source (this occurs once per frame for various tags, with non-interruptible progress displayed). So, links in the hybrid book should work, but certain functions like View:Load with Images and View:Load Links do not.

If you also enable Merge Frames, Newt's Cape actually copies the fixed source for individual frames into the source of the main document; subsequent redisplay of the new main document should be much faster and more functional (View:Load with Images, View:Load Links); if the individual frames are not shared by other main documents on the same site, you can Delete them from the cache (and if they are needed later, they will be reloaded).

IFRAME

IFRAME is like FRAMESET with a single FRAME, but containing a NOFRAMES section.

For More Info

This document (in all its formats) is © 1995-2007. Steve Weyer, Greg Simon. All Rights Reserved Worldwide

Version 2.1. Last updated: Dec 2000