home account info subscribe login search My ITKnowledge FAQ/help site map contact us


 
Brief Full
 Advanced
      Search
 Search Tips
To access the contents, click the chapter and section titles.

HTML 4.0 Sourcebook
(Publisher: John Wiley & Sons, Inc.)
Author(s): Ian S. Graham
ISBN: 0471257249
Publication Date: 04/01/98

Bookmark It

Search this book:
 
Previous Table of Contents Next



Table 6.8 Elements Allowed in the Document HEAD
TITLE Provides the title of the document.
ISINDEX Indicates that the document is searchable.
BASE Records a record of the original URL of the document.
LINK Defines a relationship between the document and another document.
META Provides meta-information about the document that cannot be expressed in the preceding elements.
SCRIPT Embeds executable program scripts, or references an external file that contains a program script. In both cases the script should be applied to the current document.
STYLE Embeds style sheet instructions. The style sheet information should be used to format the document BODY.

BASE is an empty element and is optional. BASE has a single mandatory attribute, HREF, which is assigned the base URL of the document. The base URL references where the document was originally located. Consequently, a document can have at most one BASE element.

BASE is useful for documents moved away from their original URL—after moving the document, partial URLs that referenced neighboring documents are no longer valid. However, if the original URL address is specified in a BASE element, relative URLs from this document are evaluated relative to this “base” URL and are correctly referenced at the original location.

If the BASE element is absent, the browser determines partial URLs relative to the URL used to access the document.


NOTE: Possible Problems with BASE

Be aware that browsers differ in their interpretation of BASE when it comes to “bookmarking” a document or to accessing FORM or ISINDEX-referenced resources: Some browsers use the BASE URL in these cases, while others use the actual URL needed to retrieve the displayed document.


The following is an example of the appropriate use of BASE. If a document was originally found at the URL:

http://somewhere.org/Dir/Subdir/file.html

the appropriate BASE element to include in this document is:

<HEAD>
   <TITLE> some sort of title.... </TITLE>
   <BASE HREF=“http://somewhere.org/Dir/Subdir/file.html”>
</HEAD>

BASE Support for Netscape Frames

Browsers that support the frame elements support targeted links—this lets a document author direct the data returned, upon selecting a hypertext link, to a particular named browser window or named pane within a window—all browsers can produce multiple copies of themselves, while frame-capable browsers can create multiple window panes within a single browser window. Named windows are produced by using a TARGET attribute to the A (anchor) element or by using the FRAMESET element, as discussed in Chapter 7.

Browsers that support frames also support a TARGET attribute with the BASE element. Analogous to the value of HREF, TARGET defines the default name of the target window for all hypertext links within the document. For example, the element

<BASE TARGET=“window3”>

means that all accessed hypertext links will be displayed in (sent to) the window named window3 . If a pane by this name does not already exist, then a new browser window will be created, and will be assigned this name.

A BASE-specified target is overridden by an explicit TARGET within an anchor, such as:

<A HREF=“/path/file.html” TARGET=“window2”>anchor text</A>

The document returned upon accessing this anchor will be directed to the window named “window2,” overriding any target implied by the BASE element TARGET value. The default target is always the window or frame containing the document currently being displayed.

ISINDEX Element: Searchable Document

Usage: <ISINDEX>
Can Contain: empty
Can Be Inside: HEAD
[BLOCKQUOTE, BODY, CENTER, DD, DIV, FIELDSET, FORM, LI, NOFRAMES, NOSCRIPT, TD, TH,
APPLET, IFRAME, OBJECT]
Attributes: CLASS, DIR, ID, LANG, STYLE, TITLE,
ACTION, PROMPT

ISINDEX is an optional, empty element. Because there are many older documents that have ISINDEX in the BODY, HTML allows this placement; ideally, ISINDEX should be inside the HEAD. This element informs the browser that the document can be examined using a keyword search and that the browser should query the user for a search or query string. The attribute PROMPT, which takes as its value an arbitrary author-specified string, specifies the prompt that should be presented for this query; for example:

<ISINDEX PROMPT=“Please enter your favorite ice cream flavor:”>

ISINDEX does not mean a search of the text being read. Documents containing ISINDEX elements are usually sent to the client from server-side gateway programs designed for database searches. You can think of such a document as a front end to a gateway program and the document you search as the database represented by the document you see.

By default, ISINDEX-accepted data are returned to the same URL that was used to retrieve the document containing the ISINDEX element. Several browsers support an ACTION attribute, which takes as its value a URL to which the query should instead be directed. This is supported by both Navigator and Internet Explorer.


NOTE: ISINDEX to Be Dropped from HTML

The ISINDEX element is marked for deletion from the HTML specification and should not be used in new documents. ISINDEX queries can instead be mimicked using the following FORM markup:

<FORM action="url-for-query" method="get">
Enter your search phrase: <INPUT type="text">
</FORM>

where url-for-query is the URL to which the query string should be sent. Note that, to properly emulate ISINDEX, you must omit the NAME attribute from the INPUT element.


The encoding mechanism by which ISINDEX query data are appended to a URL is discussed in the http URL section of Chapter 8 and also in Chapter 10.

LINK Element: Relationship to Other Documents

Usage: <LINK>
Can Contain: empty
Can Be Inside: HEAD
Attributes: CLASS, DIR, ID, LANG, STYLE, TITLE, standard event handlers,
CHARSET, HREF, HREFLANG, MEDIA, REL, REV, TARGET, TYPE

LINK describes a relationship between a document and other documents or objects. For example, LINK can indicate a related index, a glossary, or perhaps different versions of the same document. Alternatively, LINK can point out likely next or previous documents. This information could be used by a browser, among other things, to predict and preload documents it is likely to need, or to configure customized navigational buttons or menus. A document may have any number of LINK elements to represent these various relationships to other documents.

LINK is an empty element and is optional. The HREF attribute (a URL that points to the linked resource) is mandatory, as is at least one of REL or REV: REL or REV take text string values that define the nature of the relationship between the linked resources. All other attributes are optional. Indeed, most other attributes are not understood by current browsers.


Previous Table of Contents Next


Products |  Contact Us |  About Us |  Privacy  |  Ad Info  |  Home

Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc.
All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited. Read EarthWeb's privacy statement.