engcomp,
As you can see, frames are controversial. It's only fair to warn you this note is long and detailed - some opponents of frames say nothing about ways of getting the benefits while avoiding / mitigating the drawbacks, so I've described a few.
This note assumes all the processing is done in the browser, because I don't know whether server-side programming is avaiable to you.
Considering the length of this note you may wonder whether frames are worth the trouble. If you want a vertical navigation bar your options are:
* present it as simple HTML within each page and accept that the user will have to scroll the entire page to get to the menu. You also have to keep all the copes of the menu bar in al the pages up-to-date, and decide how to highlight the men option representing the currnet page.
* use DHTML. There are several techniques but the big difficulties are that 14% of users run with Javascript turned off and that different browsers support different DHTML models so your code would have to contain a lot of "if browser A do X else do Y" logic.
* use frames because they are more uniformly supported by browsers and less work that the previous 2 options (version 1 of my site,
used frames with no Javascript because I had not learned Javascript at that stage).
For a wide range of opinions on frames look at
and search for frames
Things you should consider:
* accessibility, i.e. ease of use by people with visual and other disabilities. Several countries have laws requiring at least some kinds of site to cater for with visual and other disabilities.
* getting listed by search engines.
* what happens if a user follows a link to a page you expect to be displayed in the frameset. Can they see your menu?
* bookmarking
* printing
* legal implications of accidentally showing someone else's page in your frameset.
Almost the first question is whether your site has to be concerned about "accessibility", i.e. ease of use by people with visual and other disabilities. Frames are very visual and the devices with which blind users translate pages into synthesised speech or braille don't understand frames. But in the long run I suspect sites concerned about accessibility will have 2 versions of the relevant pages, for the blind and for other users, because:
* blind users need text-dominated / text-only pages which can be read in strict line-by-line sequence.
* users with "normal" vision don't want to read lots of text and like visual cues such as having the menu in a vertical band with a different background.
See the section "End of Single-Design Pages?" in Jakob Nielsen's article "Disabled Accessibility: The Pragmatic Approach" at
For users with "normal" vision, having the menu in a vertical band with a different background is a good idea. There are other ways of achieving this beside frames (see
but most rely on Javascript and about 14% of users have Javascript turned off (see
For the moment I think frames are often the lesser evil (my site,
uses frames).
To improve your chances of getting listed by search engines, put in your frameset page a NOFRAMES block which links to all your content pages - and keep this up-to-date!
Solutions to most of the other issues depend on Javascript and will not work for the 14% who don't run Javascript. I suggest you include in all your pages NOSCRIPT blocks which say it will be much easier to use your site if they enable Javascript.
If a user follows a link to a page you expect to be displayed in the frameset, you can use 2 Javascript "programs" to force the page into your framset:
* a separate file, included in all your content pages, which loads the framset and passes it the URL of the required content page, e.g.
self.location.replace('frameset.htm?page=' + escape(self.location.href);
* code in the frameset which parses the "?page=required_page.htm" part of its URL (self.location.href) and loads the required page into the content frame.
Book-marking is the tough nut. I dont'know why browsers only bookmark the visible URL (as shown in the address / location bar) and not the complete status of the frameset. They do track the complete status of the frameset, as you can see by moving around any frames site and then using the Back and Forward buttons.
IE 4+ and Netscape 4+ will bookmark a framed page if the user right-clicks in the content frame and selects the appropriate option from the pop-up menu. The bookmark will refer to the framed page only (i.e. the content page will try to display with frames), but the Javascript code described above will get round that. If you rely on this you should add some help text.
You could make all the links in in your pages, including the menu, of the form
frameset.htm?page=required_page.htm
When the frameset reloads it will use the Javascript described above to load the required content page and the displayed URL will be
frameset.htm?page=required_page.htm
so bookmarks will work even if the user simply uses the browser's toolbar / menu to bookmark the page.
The only disadvantage I can see is that reloading the framset will cause the entire screen to flicker, even if everything is loaded from the browser's cache.
Version 4+ browsers will print a framed page if the user right-clicks in the content frame and selects the appropriate option from the pop-up menu. If you rely on this you should add some help text.
According to an article I read you can also print the entire frameset by Javascript code
top.window.focus();
top.window.print;
but I haven't tried this.
Be very careful about linking from a framed content page to another site's page. Some sites regard this as an attempt to re-badge their content and will sue.
To link from a framed content page to another site's page, do one of:
* set the TARGET attribute to "_top" so that your frameset is overwritten by the requested page.
* open the other page in a new window, e.g. by setting the TARGET attribute to "_top" so the page opens in a new window and your frameset is still present in the original window.
You'll be relieved to know that's all! I suggest you review the options (straight HTML, DHTML or frames) before committing yourself to any work.