Working with Frames in Browsers not Supporting this Feature
Frames are supported only by version 2 and higher of Netscape navigator and Microsoft Internet Explorer. When someone accesses a page containing frames with a browser that doesn't support this feature, nothing is displayed how do you solve this problem? In these cases, use the <NOFRAMES> command, which allows the inclusion of warning or HTML commands that can be viewed by the browser. When a browser that doesn't support frames find the <FRAMESET> or <FRAME> commands, it simply ignore these commands.
The <NOFRAMES> command works like a container within the structures of the <FRAMESET> command. Within it, any HTML commands may be specified. These commands are only executed if the frameset cannot be loaded by the browser.
Take into consideration users whose browsers don't support frames. We suggest the following alternatives when creating your page with frames:
- Use the <NOFRAMES> commands and issue a warning that the browser used does not accept frames. You can even suggest addresses from which a new version of the browser may be downloaded. (This example will be shown below.)
- Create an initial page that allows the user to choose between viewing a version with frames or another without frames.
The first option requires the least work; however, you will lose many users who do not have a compatible browser.
The last two alternative, particularly the last, are the best from an operational point of view; however, they require more development work.
As an integral part of all the pages created with frames, you should use a <NOFRAMES> command with standard text advising about the need to use a compatible browser or to activate alternative pages. Examine the basic source code of a document using this technique below:
NOFRDEMO.HTM File:-
<HTML>
<HEAD>
<TITLE>Noframes</TITLE>
</HEAD>
<FRAMESET cols=35%,65%>
<FRAME src=c.htm>
<FRAME src=b.htm>
<NOFRAMES>
</P>This page uses Frames, a feature not supported by the Browser being used. We suggest obtaining an updated version of Netscape navigator 4 or Internet Explorer 4 through the following sites:
<P>
Microsoft: <A HREF="http://www.microsoft.com">http://www.microsoft.com</A>
<P>
Netscape: <A HREF="http://home.netscape.com">http://home.netscape.com</A>.
<P>
</NOFRAMES>
</FRAMESET>
Here is the result of the code displayed by a browser that supports frames:
And this is what happens when the browser cannot display frames (this example is displayed in word, however, rather than a browser):
Including Help Pages
Our second project consists of creating and expanding the capabilities of the electronic manual by adding a help page. This window will be at the bottom of the browser window, and will display the contents of help files associated with some term selected, or else to display an overall description of the system. In addition to providing online help, this document may be viewed by a browser not supporting frames.
MENUFRA2.HTM File:-
<HTML>
<HEAD>
<TITLE>menufra2.htm</TITLE>
</HEAD>
<FRAMESET rows=80%,*>
<NOFRAMES><BODY bgcolor="#ffffee">
<H1><CENTER>Main menu</H1></CENTER>
<UL>
<LI><A HREF=a.htm>Introduction</A>
<LI><A HREF=b.htm>Chapter 1</A>
<LI><A HREF=c.htm>Chapter 2</A>
<LI><A HREF=d.htm>Chapter 3</A>
<LI><A HREF=e.htm>Chapter 4</A>
<LI><A HREF=f.htm>Chapter 5</A>
</UL>
</body>
</NOFRAMES>
<FRAMESET cols=30%,*>
<FRAME name="menu" src=indcap2.htm>
<FRAME name="texts" src="nothing.htm">
</FRAMESET>
<FRAME name="help" src="nothing.htm"></FRAMESET>
</frameset>
</html>
Note in the code above that the <NOFRAMES> command contains the code of the main menu of the manual.
We used the same frames structure of the MENUFRAM.HTM document, except that this time, a document called NOTHING.HTM is automatically loaded to the frames called text and help. This NOTHING.HTM document contains only the code required to change the background colour.
NOTHING.HTM File:-
<html>
<head>
<title></title>
</head>
<body bgcolor="#80FFFF">
</body>
</html>
The INDCAP2.HTM file is a variation of the INDCAP.HTM document. It contains a mention of a new chapter of the manual and adds two more links, which are shown after the menu. See the code below:
<html>
<head>
<title>Main menu</title>
<base target="texts">
</head>
<body bgcolor="#FFFFEE">
<h1 align=center>Main menu</h1>
<ul>
<li><a href="a.htm">Introduction</a></li>
<li><a href="b.htm">Chapter 1</a></li>
<li><a href="c.htm">Chapter 2</a></li>
<li><a href="d.htm">Chapter 3</a></li>
<li><a href="e.htm">Chapter 4</a></li>
<li><a href="f.htm">Chapter 5</a></li>
<li><a href="g.htm">Chapter 6</a></li>
</ul>
<p align=center><a href="sos.htm" target="help">Enables help</a><br>
<a href="nothing.htm" target="help">Disables help</a> </p>
</body>
</html>
The first link, if it is activated, loads a file called SOS.HTM to the the help window. The second link clears the contents of the help window. To do this, it simply loads the NOTHING.HTM file back to that window.
The new chapter, which is called G.HTM is shown next. It contains simple text in which a key word, which is this case is "frames," has explanatory text associated with it. Clicking on this word loads the FRAMEHLP.HTM file, which contains the explanation of the term, to the help frame.
After reading the text, the user can press the disable help option of the main menu to clear the help window.
Here is the source code:
<html>
<head>
<title>Chapter 6</title>
</head>
<body bgcolor="#FFFF80">
<h1>Chapter 6</h1>
<hr>
<p>This chapter describes some basic concept related to the use of the features of <a href="framehlp.htm" target="help">frames </a>and their use in the creation of homepages.</p>
<ul>
<li>What are Frames</li>
<li>General syntax</li>
<li>Practical examples</li>
</ul>
<p> </p>
<hr>
<h5>Jose; Antonio Ramalho.<br>
Copyright © 1998 J.Ramalho Assessoria e Treinamento<br>
</h5>
</body>
</html>
The next figure shows the browser displaying the generic help after the enables help link is the main menu was pressed.
The next illustration shows Chapter 6 being displayed.
To eliminate the help text, click on the disable help option of the main menu. The next figure shows what happen when the word "Frames" is clicked.
Frame Nesting
You can nest framesets and create complex frame structures. To nest a frameset within another, use the <FRAME> command to load a document containing a frameset definition. Suppose you have a main document which defines a frameset with two horizontal windows, as shown below.
| x.htm |
| ywz.htm |
<html>
<head>
<title>A</title>
</head>
<frameset rows=*,*>
<frame src=x.htm>
<frame src=ywz.htm>
</frameset>
</html>
In the top window you load in normal HTML document called X.HTM. In the lower Windows, load a document containing a new frames definition called YWZ.HTM, as shown below.
| y.htm | w.htm | z.htm |
<html>
<head>
<title>YwZ</title>
</head>
<frameset cols=*,*,*>
<frame src=y.htm>
<frame src=w.htm>
<frame src=z.htm>
</frameset>
</html>
The result is a window composed of two sets of frameset.
| x.htm | ||
| y.htm | w.htm | z.htm |
It's quite simple, isn't it? However, the more nested framesets, the more complicated the navigation. See how the MASTER.HTM document looks when loaded.
Names of Special Windows










No comments:
Post a Comment
If you have any doubts. Please let me know.