Outer Court

Tech - Posts to comp.infosystems.www.*

From: "Philipp Lenssen" <lenssen@hitnet.rwth-aachen.de>
Newsgroups: comp.infosystems.www.authoring.html
Subject: Re: Frames - so what are the alternatives
Date: Wed, 6 Jun 2001 08:58:52 +0200
Message-ID: <9fkk8o$67d$1@nets3.rz.RWTH-Aachen.DE>
Ian McCarthy <idm@cronkshaw.com> schrieb in im Newsbeitrag:
> I am aware that purest believe that frames are bad, and w3c do not
> appear to be providing clear guidence, however I have yet discovered, a
> site which explains what a similar solution to using frames would be to
> provide a fixed navigation area, so I guess i have 3 questions
> a) What combination of html and style commands achieves the same effect
> that I could achieve with Frames and which browsers support these
> features?
> b) given that target="_top" isn't allowed, does one have to use have to
> use Javascripts, to stop ones self being framed?
> c) What is the long term proposed solution?

You get so many advantages from thinking outside of frames. If your content
is database driven and then navigation is generated on the fly, not using
frames is actually making your life much easier, and also the visitor's life
of course.

Basically, CSS2 (absolute positioning) is a great way to achive similar
effects, if you can live with the fact that the navigation will scroll out
of sight on some pages (really nothing bad, actually even making the page
appear more like one). You can't get the exact same thing on all browsers
trying to replace frames, you can try to have scrollable areas by using e.g.
the overflow scroll property on IExplorer and sizing the content layers to
fit the screen, then people will not scroll away the navigation. Also you
can use position: fixed on some browsers.

You don't have to care anymore for setting up a complex JavaScript link
scheme, always caring about not destroying the browser history and making it
work without JavaScript, and every link will take you to a single document
the visitor wants to go to, and the navigation will just come along with it,
that's really the way to go as it gets rid of tons of problem. Have you ever
tried to put up a bookmark for a framed document in Netscape? Or saw what
happens if you don't JavaScript generate the context if a search-engine
links to a content-frame document of a site? Clients calling trying to
print a site, and ending up with a blank paper?

If however you don't have the possibility of server-side scripting, or
script pre-processing the offline version, you might run into some problems
maintaining your site's navigation, that's when frames come in handy.
They're not evil and really supported by every browser if you set up the
navigation correctly and provide a noframes alternative (which can be as
little work as just linking to the navigation frame). Note that by supported
I mean even ignoring frames in meaningful ways.

About being framed by other sites, why do you care really? I don't think
defensive JavaScript coding in that area is really worth the time, or worth
the client's money for that. If your site becomes popular, yes then people
might also link direcly to your images, quote you in ways you think are
unfair, link to you, and yes even try to frame your site (well it even
happens in say hotmail-referenced sites from withing an email).

Four years ago I might have been thinking frames were the way to go but the
more you learn the more you'll try to avoid them, especially if you want to
make use of the visitor's browser resolution in the best way, you'll be
running into lots of problems in that area with frames. Well, as long as you
don't go for the 5 frames solution just to center your content in a clean,
well-defined small zone to definitely get pixel perfect print layout,
they're still not as evil as you might think, and can even be made
downwards-compatible if you're not trying to dynamically switch both
navigation and content areas, or trying to have two navigation frames (which
is really when you start investing extra-time making it work without
JavaScript, in different browser contexts and so on).