14.2. Introduction to Frames
Frames
allow you to divide the browser window into smaller subwindows, each
of which displays a different HTML document. Introduced by Netscape
Navigator 2.0, frame support was soon added by other popular
browsers. The basic frame specification works with Netscape Navigator
2.0 and higher as well as Microsoft Internet Explorer 3.0 and higher.
As of this writing, frames have found their way into the World Wide
Web Consortium's HTML 4.01 specification.
Despite the advanced navigational functionality that frames offer,
they do present certain problems and peculiarities that have lead to
their currently controversial status. In fact, they've become
so notorious that it is not uncommon for web developers to encounter
clients who, despite not knowing a lick of HTML themselves, strongly
proclaim, "No frames!" at the beginning of a project.
Like most things, frames are neither all good nor all bad. It is your
responsibility to be familiar with both sides of the coin so you can
help present the best solution for your clients' needs.
14.2.1. Advantages
Consider these advantages to using frames:
-
The main advantage to frames is that they enable parts of the page to
remain stationary while other parts scroll. This is useful for
elements you may not want to scroll out of view, such as navigational
options or banner advertising.
-
Frames unify resources that reside on separate servers. For instance,
you may use frames to combine your own material (and navigation
graphics) with threaded discussion material generated by software on
a vendor's server.
-
With the <noframes> tag, you can easily add
alternative content for browsers that do not support frames. This
degradability is built into the frames system.
14.2.2. Disadvantages
Also keep in mind these disadvantages:
-
Frames are not supported by some browsers. (<noframes>
may address this problem.)
-
Frames may make site production more complicated because you need to
produce and organize multiple files to fill one page.
-
Navigating through a framed site may be prohibitively challenging for
some users (especially users with disabilities who are using
alternative browsing devices).
-
Documents nested in a frameset may be
more difficult to bookmark. Bookmarks identify only the top-level
framed document in its initial state; there is currently no way to
track the states of a frameset and therefore no way to bookmark
individual states. There are workarounds in 4.0 browsers, however,
such as opening the contents of the frame in a new window and
bookmarking that page.
-
A
large number of frames on a page may significantly increase the load
on the server because so much of the load on a server is initial
document requests. Four requests for 1K files (the frameset and the
contents of three frames) is more work for your server than a single
request for a 4K document.
-
Framed documents can be a nuisance for search engines. Content-level documents
may be missed in searches. If a contained document is found by a
search engine, it will probably be displayed out of context of its
frameset, potentially losing important navigational options. For more
information on searching framed documents, see Section 14.7.3, "Helping Search Engines" later in this chapter.
-
It is more difficult to track actual page (or ad) impressions when
the pages are part of a framed document.
That said, let's look at how framed documents are constructed.
| | | 14. Frames | | 14.3. Basic Frameset Structure |
Copyright © 2002 O'Reilly & Associates. All rights reserved.
|
|