Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Frames, should I use them or not?

Status
Not open for further replies.

UncleMortis

Programmer
Jan 28, 2003
120
AU
Ok, When I learnt html, there was a whole chapter on making frames. I'm noticing however that it's not such a good Idea in regards to search engines etc. Though before the frames page, I do tend to put a single index.html page as the splash page so it finds that first. What are other's thoughts on the use of frames?
 
nah...if you have asp or php or ssi on your server use includes [soapbox]
sleep is good
 
imo...

frames = "big mess" what we see depends mainly on what we're looking for.
--unknown
 
Frames are an excellent tool when used correctly, which seems to be about 1% of the time.
In my opinion avoid them!!

Why:
-Older browsers cannot load frames! PDA's and web enabled mobile phones are becoming more and more common, many of which cannot load frames either. Frames are TOTALLY INCOMPATIBLE with browsers which do not support it.

-Abuse of frames, some sites 'trap' you in their frames so whatever link you click their ads etc remain in the top frame of your browser.

-Bookmarks don't get set properly for framed sites. Also a specific combination of frames cannot be bookmarked.

-Too much scrolling required if frames poorly designed.
In some buggy Netscape browsers images may load even if image-loading is turned off.

-No URL associated with the frameset. Only the initial document can be linked to or bookmarked.

-With framed pages the focus is on layout which goes against the principle of HTML being platform independant.

-Printing framed pages can be a problem as only the active frame will print.

-Scripting is much more difficult if you want dynamic pages.

-Targeting content to specific frames can get messy.
Making "right" framed pages tends to be much more work than making the pages without frames.

-Some search engines will not spider framed pages.
If you site is found through a search engine the visitor may only load a individual page without any navigation/headers or other information which would be contained in frames.

-You should create a no-frames version of your site. Any point is creating 2 sites? Just drop the framed version altogether.

-Simple mistakes like forgetting a target="top" can result in your site self-nesting

-Frames are crap.



É
::
 
I get what you are saying about the frames if there is a mistake made with targets etc. I personally don't make mistakes like that but can see your point. What are alternatives to frames? I was thinking of just using tables because I'm a creature of habit who tends to put the links down the left side. When is it ok to use a framed page? I mean, there should be a time and a place shouldn't there?
 
well, when I was learning web desing first, about a year ago, I used to think frames were soooo cool .. niave or what!!

anyway, I just happened to stumble across this site, - it's supposed to be tips for a good website, have a look at tip60:
!!!!!

Good job I hadn't added the site to my favorites yet!!
 
Seems like people have had nightmares with frames. I haven't had any problems with getting them to work. What are the alternatives that you use instead of frames?
 
I can get them to work, but they're just considered unprofessional, search engines have problems with them, and you can't bookmark a particular area of the site ... all the stuff cian pointed out above.

I'd use tables insted, if you want something to be visible all the time, even when the user scrolls, then you could use a floating layer, if you go to - there's some free code there you can use. bupa.com, or else bupa.ie (I can't remember which) uses one of these and I think it looks real nifty!!

there are loads of alternatives, and if your page doesn't have an awful lot of content, then there might not be any scrollbar - thus eradicating the need for frames entirely!!
 
If I use layers on my page say for my top navigation menu, can I use javacript or html to just change the content under the top navigation menu?

For example,
In this site, if I click on say Classifieds>Personal, only the bottom content changes, how do they do this?
 
You can easily get the functionality of frames by using object tags(crap) or better yet with SSI (simple) or basic php. SSI is very easy and is one of the best ways of getting the same maintainability of frames but with 0.5% of the headaches!
(PLUG: theres some SSI guides on my site you can steal)

You can get the "look" of frames with the dhtml provided by the lads above. But personally I hate the "look" of frames, boring and static and rarely designed well.

É
::
 
UncleMortis,

Restoring some rationality to the frames debate: (in my dreams)

First of all what is a frameset? Let us look at an example:

NAME THIS frame1.htm
<html><head><title>Frame 1</title>
<style>body {color:black; background:blue}</style>
</head><body><div align=&quot;center&quot;>Frame 1</div></body></html>

NAME THIS frame2.htm
<html><head><title>Frame 2</title>
<style>body {color:black; background:yellow}</style>
</head><body><div align=&quot;center&quot;>Frame 2</div></body></html>

NAME THIS frame0.htm
<html><head><title>Frame 0</title>
<style>body {color:black; background:green}</style>
</head><body><div align=&quot;center&quot;>MENU<br /><br />
<br /><a target=&quot;TEXT&quot; href=&quot;frame1.htm&quot;>Frame 1</a>
<br /><a target=&quot;TEXT&quot; href=&quot;frame2.htm&quot;>Frame 2</a>
</div></body></html>

NAME THIS frameset.htm
<html><head><title>Frameset</title></head>
<frameset cols=&quot;30%,*&quot; frameborder=0 border=0>
<frame src=&quot;frame0.htm&quot; name=&quot;MENU&quot; >
<frame src=&quot;frame1.htm&quot; name=&quot;TEXT&quot; >
</frameset></html>

frame1.htm, frame2.htm and frame0.htm DO NOT even know they are frames and can work quite happily without being part of a frameset. For example: Click on frame0.htm and it will give you access to frame1,htm or frame2.htm.

So without even using a frameset you could provide a situation where your main page is always active even if the user closes subsequent screens, and where your navigation system is very maintainable.

One question to ask yourself when deciding whether or not to use a frameset is: &quot;For my particular application, would it be helpful to show one or more of my screens, at the same time, within the same browser window (frameset)?&quot;

Ease of navigation is one of the reasons, but not the only reason, why you might choose to use a frameset. As has been pointed out, the same maintenance benefits could be derived using server-side includes. However, server-side includes require the HTML to be resident on a server. Perhaps you may want your HTML to be used locally and then server-side includes would not be appropriate.

Another reason to use frames is that they can be very fast. This is especially helpful for users with slow connections and older machines. Suppose the menu frame has a picture in it, the picture or the frame itself never needs reloading. Even loading from cache takes time and is futile and klutzy from a data-processing elegance standpoint.

The most compelling reason to use frames however, is when your application requires programming techniques such as; communication between screens; reuse of screens (keeping most of the code but changing certain variables); maintaining state; etc. etc.. Query Strings can be passed between screens and be invisible to the user because the address display never changes.

It is my opinion that the arguments against ever using frames fall into 4 categories.

1. Simple prejudice
example: Frames are crap, awful, useless etc.
2. Misinformation:
example: Frames confuse search engines
3. Specious
example: Some browsers do not recognise framesets
4. Valid
example: A casual user might not know how to bookmark a particular page that is part of a frameset.

In my opinion framesets should be thought of as a valuable tool which may or may not be useful depending on the particular application.

Clive
 
Clive,

You miss or barely touch on some important points.

Your point 2: misinformation or fact? Badly build framed sites which are extremely common on the web do have their issues with search engines!

Your Point 3: I regularly use the internet with a browser that doesn't support frames, Why? because it fast, light, portable and sometimes I need to get online and may not be near a PC. And so do many others!

Your point 4: i.e. a vast percentage of web surfers, customers

Add Point 5: that a huge percentage of frames users don't have a clue what they are going and end up building useless websites.

I personally still see little reason why anyone should go for frames. I do think they are crap, it's not prejudice, it's just my opinion formed after seeing hundreds of sites badly build with frames!

Frames definitly have their uses, they are an excellent tool when used well. All too often I have seen them badly used.


É
::
 
Some interesting points there, Clive, but I'd take issue with some of them...

server-side includes require the HTML to be resident on a server

Errr.. all websites require the HTML to be resident on the server. How would you make it resident on the client? The real drawbacks of server side includes are the slight performance hit, as the server has to check the page for includes as it serves it, and that SSI is often not made available to users of free/cheap hosting services.


Another reason to use frames is that they can be very fast

They can be, but the performance benefit is not necessarily all that great. Static information like navigation bars and site titles are loaded only once instead of for every page, but such things are often pretty fast-loading anyway (unless they're some manky Java applet - but using those is a MUCH worse sin than using frames!). I don't think te issue you raise about repeatedly loading an image is a real one. Whenever you visit a page your browser stores all its images in its cache, if that image is re-used on another page it is retrieved (very quickly) from the local cache instead. I call that VERY elegant.

I find it difficult to follow your &quot;most compelling reason&quot;. I think you're saying that you could present search results with the user's criteria in one frame and the results in another. Indeed you could, but it's not the usual way of doing it. It's quite easy to maintain state by using hidden form fields, which is what most professional search engines do. If it's good enough for Google it's good enough for me!

Frames DO have their advantages, as you've pointed out. They also have real disadvantages...

[ul]
[li]Search engines should be able to cope with frames (at least any one worth using should), but the problems arise from the results they present. They'll link to content pages within your site - which will be brought up without title, navigation frames or whatever. This looks really naff.

[li]Bookmarks have a similar problem, you can only bookmark the content page (if you know how) or the frameset (containing the front page).

[li]Links have the same problem again: you can't link to a page within the site. I want to encourage people to link to my sites as much, and as easily, as possible. Frames get in the way.

[li]Browsers don't always support frames. &quot;Normal&quot; users accessing the web through a computer will generally have no problems, but what if they're using a phone? a PDA? a TV? a blind person's screen reader? I'd rather take no chances.
[/ul]
The advantages of frames are obvious, the disadvantages are more subtle. I think that's one reason a lot of framed sites are &quot;crap&quot; - people build their first sites with frames (I know I did), discover the problems and (re)build their later, better sites without them.

I don't think frames are &quot;crap&quot;, they're potentially quite useful - but in the real world their problems often outweigh their potential usefulness. Use them if you must, but do it with your eyes open. -- Chris Hunt
Extra Connections Ltd
 
I am tempted to say that: &quot;I rest my case&quot;. However, humour does not always come over well in this flat environment.

It seems that framesets have become a religious issue and it would take someone more persuasive and diplomatic than I to convert any kind of religious zealot. My message is for the undecided.

I couldn't give a damn whether other people choose to use frames or not, it is just a bit frustrating to see so much mis-information posted on the subject.

Most every objection to framesets raised here has a simple technical solution and they can all be found by searching the tek-tips site. Those more to do with search engines are covered here also: and on many other sites on the web.

PDA's are a red herring. Just don't use framesets and all will be well seems to be the message. If you are intending for your site to be used on a PDA or a cell phone you will need to do much more than that.

Older browsers that don't support frames don't support a lot of other stuff either but I never hear people suggest that we should not use CSS or Javascript.

Cian's first message in this thread, quotes (without attribution), from an article that was written in 1997 and which is completely out of date.

The bookmarking/deep-linking issue could actually be a benefit of frames. Do you want someone to link to an odd page in your site or would you prefer for them to come through the front door? You have a choice.

if (top.location == self.location) {
self.location.replace
(&quot;index.htm&quot;)
}

Out-of-the-box thinkers might want to give some thought to the issue of deep-linking. A Danish court recently held that: &quot;a news site cannot provide hyperlinks to certain Web pages without the permission of publishers.&quot; There could be a business opportunity here for showing corporations how they might prevent deep-linking into their sites.

Many search engines these days ignore meta tags and only go for &quot;real&quot; website content. A little thought might lead to a new appreciation for the <noframes> tag. Nodd nodd, wink wink, say no more.

That's all. I have got work to do.
Absolutely no offense is intended to anyone.


Clive
 
I'm not a huge fan of frames (I pretty much avoid them at all costs). I've hear that they're considered unprofessional. Ask yourself this: Do you know any MAJOR websites that use frames anywhere? Get the Best Answers! faq333-2924
Is this an asp FAQ? faq333-3048

mikewolf@tst-us.com
 
Yeah, that's a major site, but it only for us techies. They use frames because of the shear amount of data and they wany to mimic their own windows help files. I mean Amazon, eBay, priceLine, Monster, etc. Get the Best Answers! faq333-2924
Is this an asp FAQ? faq333-3048

mikewolf@tst-us.com
 
This is cracking me up...This is like an argument for abortion :() [soapbox]
sleep is good
 
Frames have there place like all other web authoring techniques and scripts, the arguments for and against are compelling. Some of the arguments against however can be said about html, javascript or stylsheets. It,s badly writtes code/documents that cause most of the problems the problems. Frames are useful and can provide advantages on certain sites, but you dont have to use them if you don't want to. It's not a lie if you believe it!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top