The Wayback Machine - https://web.archive.org/web/20080509121147/http://www.webreference.com/html/tutorial15/1.html


spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / experts / html / tutorials / 15 / 1

index123456

Tutorial 15: You've been Framed, Part II

Biz Resources
Contact Management Software
Domain Name Services
Internet Security
Developer News
MicrosoftÂ’s Automated Agent: Can We Talk?
Borland Finally Sells CodeGear
Red Hat Heads For The JON 2.0

The trouble with frames

Way back in Tutorial 1, I mentioned that the main function of the Web is to provide documents that are linked to each other. In Tutorial 2, we explored the fundamentals of linking by explaining URLs and hyperlink heads and tails. The most important feature of the Web is that any document or part of a document can be linked to from somewhere else in the Web. This is accomplished by our friend the anchor element, A.

Another critical tool we use to link documents is URLs. A URL should be the only thing you need in order to refer to a document or document fragment. It's supposed to be a simple, human-readable address for any document you might want to have anywhere on the Web.

One problem that is often overlooked when designing framed sites is that it is impossible to link to a set of framed documents other than that defined by a frameset. Let me explain this with an example. Imagine the following frameset:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN"
 "http://www.w3.org/TR/REC-html40/frameset.dtd">
<HTML>
<HEAD><TITLE>Acme Computer Corp. Homepage</TITLE></HEAD>
<FRAMESET COLS="20%,*">
 <FRAME NAME="sidebar" SRC="navigation.html">
 <FRAME NAME="main" SRC="home.html">
</FRAMESET>
</HTML>

You can view the example here.

This is a simple enough scenario. Let's imagine that the URL of this document is http://www.acme.com/. The document http://www.acme.com/navigation.html will be placed in the frame called sidebar. This document can contain links to various places in the site and act as a navigation aid, loading various documents into the frame called main. The main frame starts out containing the document found at http://www.acme.com/home.html, which is the main part of Acme's home page. This is what most people use frames for: A static, non-scrolling navigation bar that is constant between pages.

The alternative to this approach is to insert the navigation bar into all of the documents in the site and not use frames. The reason people opt for the framed solution is that the links in the navigation bar, which are typically the ones users will use most, are constantly visible while the user scrolls through the main page. You have to give it one thing: It's neat. It's cool. But...

Imagine you have a document called aboutacme.html in the same directory. If you didn't use frames, this document would be accessible through the URL http://www.acme.com/aboutacme.html. Now for the framed version, you remove the navigational links from this document and put them in your sidebar. You insert the appropriate link in the sidebar, which loads the document in the main frame. Viewers can load the URL http://www.acme.com/, click on the link and see the the "About Acme" page in the main frame and keep the navigational links in the side bar. This is still really neat. Here's a simple example of such a setup in action. Load this page in a frames-capable browser, and click on the "About Us" link in the sidebar. You'll see the "About Us" page. Then click on the "Home" link. You're back in the homepage. Though the actual documents in the example are rather short and will probably not require any scrolling, in the real world this would be a nice solution as users would be able to easily navigate through your site.

Frames and links don't mix

Now imagine a document that is not supposed to appear in this frameset. You're writing this document, and you want to link to the home page. Easy. Just link to http://www.acme.com/. What if you want to link to the "About Us" page? This is where things start getting hairy.

You can link to http://www.acme.com/aboutus.html, but that URL points to the "About Us" page without the sidebar. If a viewer loads this URL, he gets just the text and no way to find the rest of your site. You can link to http://www.acme.com/ and say "follow this link and then follow the 'About Us' link," but this is not really a solution, and if you've got more than a couple of pages on your site, it's definitely a problem. But before we look at some more viable solutions, let's see how big a problem this is.

index123456

Click Here



JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info

Copyright 2008 Jupitermedia Corporation All Rights Reserved.
Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
Microsoft Article: HyperV-The Killer Feature in WinServer ‘08
Avaya Article: How to Feed Data into the Avaya Event Processor
Microsoft Article: Install What You Need with Win Server ‘08
HP eBook: Putting the Green into IT
Whitepaper: HP Integrated Citrix XenServer for HP ProLiant Servers
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 1
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 2--The Future of Concurrency
Avaya Article: Setting Up a SIP A/S Development Environment
IBM Article: How Cool Is Your Data Center?
Microsoft Article: Managing Virtual Machines with Microsoft System Center
HP eBook: Storage Networking , Part 1
Microsoft Article: Solving Data Center Complexity with Microsoft System Center Configuration Manager 2007
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Intel Video: Are Multi-core Processors Here to Stay?
On-Demand Webcast: Five Virtualization Trends to Watch
HP Video: Page Cost Calculator
Intel Video: APIs for Parallel Programming
HP Webcast: Storage Is Changing Fast - Be Ready or Be Left Behind
Microsoft Silverlight Video: Creating Fading Controls with Expression Design and Expression Blend 2
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Sun Download: Solaris 8 Migration Assistant
Sybase Download: SQL Anywhere Developer Edition
Red Gate Download: SQL Backup Pro and free DBA Best Practices eBook
Red Gate Download: SQL Compare Pro 6
Iron Speed Designer Application Generator
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
How-to-Article: Preparing for Hyper-Threading Technology and Dual Core Technology
eTouch PDF: Conquering the Tyranny of E-Mail and Word Processors
IBM Article: Collaborating in the High-Performance Workplace
HP Demo: StorageWorks EVA4400
Microsoft How-to Article: Get Going with Silverlight and Windows Live
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES
webref The latest from WebReference.com Browse >
Perl Pragma Primer · Implement Drag and Drop in Your Web Apps: Part 2 · How to Create an Ajax Autocomplete Text Field: Part 5
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
SQL Server 2005 Express Edition - Part 22 - Upgrading from Microsoft SQL Server Desktop Engine (MSDE) · Vyatta: Downgrades that Pay Off · NetMotion Brings Cross-Network Support to Wireless VoIP

URL: http://www.webreference.com/html/tutorial15/1.html

Produced by Stephanos Piperoglou
Created: May 28, 1998
Revised: February 25, 1999

Morty Proxy This is a proxified and sanitized view of the page, visit original site.