Web Development Tools that Enlighten
Frames are Evil
Frames are a method of constructing a web page where the "page" displayed in the web browser is composed of multiple actual pages. The file that pulls these individual frames together and describes how they are laid out in the browser window is called a frameset. If you've been surfing the internet for any length of time, you've no doubt seen framed pages before.
Okay, I'll admit that, this page's title notwithstanding, frames are not inherently evil. Frames have a place and can be used effectively to, for example, display two pages side by side for comparison. What is evil is that frames, to the uninformed, appear to be seductively easy to implement.
The novice web designer often thinks that by only changing a portion of the page, they will save download time for the user, since only part of the page has to be downloaded. That's myth number one. Or perhaps he or she just thinks it looks "cool" to only change part of a page when a hyperlink is followed. What's cool, or trendy is not always what's best for the job.
So what's wrong with frames? Let's face it, the web is all about usability. W3C studies have shown that usability is the second most important property of a web site. From a usability stand point, there are a good many issues caused by frames. According to Steven Pemberton, CWI, Amsterdam and W3C Chair, W3C HTML and Forms Working Groups, "current frames are a disaster!" Here are my top ten frames problems.
The "Back" Button
Recent versions of Internet Explorer on the Windows platform can bookmark a specific collection of pages in a frameset. Of course, given the number of people who have abandoned Internet Explorer, depending on your particular target demographic, that may still leave a lot of users out. There is also a limitation that even those IE users can only bookmark one set of pages a specific site. If they attempt to bookmark a second set of pages, it will overwrite the first.
The "Refresh" Button
Users who press the Refresh, or Reload button may see an entirely different set of pages than the one they were viewing.
Users attempting to print the displayed page will normally print only the active frame, not the entire frameset. In other words, they may only print the navigation links instead of the page they see.
The PageUp and PageDown Keys
Much like the printing issue, keys pressed by the user, including the up and down arrow keys and the PageUp and PageDown keys are applied only to the active frame, which may not be the particular frame they wanted to scroll.
Referring Users to a Page
One of the most important traffic generators for most sites is user referrals. A user sees a site and mentions it, or e-mails a link to a friend. When following the URL, the friend may see a completely different set of pages than what they were supposedly referred to.
You've all seen them, where you mouse over a button, or link and a menu is displayed. Those menus cannot cross frame boundaries. They must be displayed entirely within a single frame. Thus, either the navigation frame must be enlarged enough to contain the menu, or the code for the menu must exist in every page that uses it.
You can never be entirely sure of the user's browser window size and text size. Consequently, scroll bars tend to pop up when and where you least expect them. Either that, or a frame has scroll bars turned off and the user cannot access the full content because part of it is off screen and has no scroll bar.
Trying to align the content of adjoining frames simply cannot be done in any reliable, cross-browser way.
There is another way you can overcome many of these issues. That is called a self-referencing frameset. A self-referencing frameset is where you use a server side script to write out the frameset. If you do a Google search, you should be able to find out how that works.
The end result is that frames do have a place on the web, but they are not a panacea to cure all ills. Don't lock yourself into a framed web design without knowing the obstacles and provide work arounds for those you can.
Okay, if I haven't dissuaded you from using frames and you really feel you must use them, go here for a tutorial that will teach you how to make the best of a bad situation. On the other hand, if I've convinced you that frames are not appropriate and you now want to convert an existing framed site back to normal pages, see my dump frames example.