View Full Version : noframes/to frames circle

08-07-2002, 06:06 PM
I'm sure this is a classic problem...

I've set up a NOFRAMES page with links to the various pages contained in the frames so the viewer can see them individually in the main window, using the browser's back arrow to get back to the NOFRAMES page.

I've also put the following code on each page so that if the visitor comes through to a page in the main window they will be sent to the FRAMESET page:

function checkifframes(){
if (top.frames.length==0)

<body onLoad="checkifframes();">

The problem, of course, is that if the viewer's browser doesn't support frames, when they click on a link in the NOFRAMES page they will catch a quick glimpse of the linked page before being sent on to the FRAMSET page and back to the NOFRAMES page. i.e. one big circle.

Is there an easy way to get round this?

(If it's a lot of hassle I'll just forego one of the options. In that case, am I right in thinking the NOFRAMES page will help more visitors? I won't be placing any keywords in the META tags on the other pages, so not much chance of someone coming through to one of the other pages, I guess; although I realize that isn't the only way search engines work).

08-07-2002, 06:13 PM
Is there an easy way to get round this?

The easy way round it is not to use frames.

But I'm not sure this problem will happen anyway. Have you tested your site in a noframes browser to see what does happen? I would have thought that such browsers:

1 - would return undefined for the frames array, so you could discriminate with if(document.frames && document.frames.length==0) to prevent noframes browsers from executing the code

2 - don't support javascript anyway, so maybe the only situation where a browser would support javascript but not frames is where a user has specifically disabled frames support ... not sure what you can do for the 1 in a billion people who fit into that category ...

But really ... you know the best solution is not to use frames.

08-08-2002, 06:23 AM
So really there isn't a problem. Yes, I was one of the 6 who turned frames off in my browser - but only to test it. I assmed doing that was the same as using a noframes browser.

Thanks for replying, brothercake.

08-08-2002, 01:37 PM
No worries.

Get a copy of Lynx - with no frames support and no javascript, it's purely text. It's very good for accessibility testing, and also gives you a good idea of how your site looks to a search robot.

08-09-2002, 07:20 AM
I use a Mac, but I went to the Lynx site and there is a beta for the Mac (MacLynx). However, it says that it supports frames. I don't suppose you'd know an alternative for the Mac?

08-09-2002, 08:10 AM
Get Opera 6 - www.opera.com

It allows you to turn off certain features, such as frames, css, etc.

08-09-2002, 12:31 PM
Thanks jkd, but that's the same as IE - I can turn frames off in that as well. Per brothercake's reply, I need a browser which doesn't support frames at all.