spacer

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

home / web / dev / frames / appendix

Appendix: The _parent Magic Target

Developer News
Mandrake Linux Founder Back, Virtually
Amazon: We're a Technology Company
Sun Expands MySQL With Closed Source

Framing the Web

The key to understanding how the _parent magic target works is understanding the relationship between parent and child. Although these concepts have to do with frame windows, it is easier to think of them in terms of files.

A parent is a file which calls another file.

Consider myframes1.html:

	<html>
	<head>
	<title>My Frames 1</title>
	</head>
	
	<frameset rows="*,2*>
		<frame src="white.html">
		<frame src="red.html">
	</frameset>
	
	</html>

In this case, myframes.html is the parent of white.html and red.html.

Any link within these child files targetted to _parent will replace myframes1.html in the window.

Suppose a link in red.html calls green.html targetted to _parent. The file green.html will load into the window of red.html's parent:

Even with more complex frame layouts, the behavior still follows this pattern:

	<html>
	<head>
	<title>My Frames 1</title>
	</head>
	
	<frameset rows="*,2*>
		<frame src="white.html">
		<frameset cols="3*,*">
			<frame src="blue.html">
			<frame src="red.html">
		</frameset>
	</frameset>
	
	</html>

Links in the child files white.html, blue.html, and red.html targetted to _parent still fill up the whole window.

In many ways, this resembles target="_top". The magic target _parent, however, can be made to act differently from _top.

Consider the following files, myframes2.html:

	<html>
	<head>
	<title>My Frames 2</title>
	</head>
	
	<frameset rows="*,2*>
		<frame src="white.html">
		<frame src="myframes3.html">
	</frameset>
	
	</html>

and myframes3.html:

	
	<frameset cols="3*,*">
		<frame src="blue.html">
		<frame src="red.html">
	</frameset>

Notice that myframes3.html is a file with nothing but a frameset in it.

In this case, myframes2.html is the parent of white.html and myframes3.html, whereas myframes3.html is the parent of blue.html and red.html.

Now, any link in red.html or blue.html targetted to _parent will replace the entire lower frame:

* * * *

Dan Brown (brown@greenonions.com) is an Online Developer for Ventana Communications Group. Besides writing and designing Web sites for Ventana and Netscape Press, Dan produces some of the multi-media CD-ROMs that come with Ventana books. Outside Web and technology development, Dan spends his time exploring online culture, information design, dogs, drumming and jazz. Dan graduated from Wesleyan University with a degree in Philosophy. His home page is (and don't say we didn't warn you): http://www.vmedia.com/dan.

This tutorial originally appeared in the March 1996 issue of Navigate!.

Comments are welcome

Copyright © 1996 Dan Brown and

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Whitepapers and eBooks

Intel Whitepaper: Comparing Two- and Four-Socket Platforms for Server Virtualization
IBM Solutions Brief: Go Green With IBM System xTM And Intel
HP eBook: Simplifying SQL Server Management
IBM Contest: Are You the Next Superstar? Join the "Search for the XML Superstar" Contest to Find Out
Microsoft PDF: Top 10 Reasons to Move to Server Virtualization with Hyper-V
Microsoft PDF: Six Reasons Why Microsoft's Hyper-V Will Overtake Vmware
Microsoft Step-by-Step Guide: Hyper-V and Failover Clustering
Intel PDF: Quad-Core Impacts More Than the Data Center
Intel PDF: Virtualization Delivers Data Center Efficiency
Go Parallel Article: PDC 2008 in Review
Microsoft PDF: Top 11 Reasons to Upgrade to Windows Server 2008
Avaya Article: Communication-Enabled Mashups: Empowering Both Business Owners and IT
Intel Whitepaper: Building a Real-World Model to Assess Virtualization Platforms
  PDF: Intel Centrino Duo Processor Technology with Intel Core2 Duo Processor
Microsoft Article: Build and Run Virtual Machines with Hyper-V Server 2008
Go Parallel Article: Q&A with a TBB Junkie
IBM Whitepaper: Innovative Collaboration to Advance Your Business
Internet.com eBook: Real Life Rails
IBM eBook: The Pros and Cons of Outsourcing
Internet.com eBook: Best Practices for Developing a Web Site
IBM CXO Whitepaper: The 2008 Global CEO Study "The Enterprise of the Future"
Avaya Article: Call Control XML in Action - A CCXML Auto Attendant
IBM CXO Whitepaper: Unlocking the DNA of the Adaptable Workforce--The Global Human Capital Study 2008
Adobe Acrobat Connect Pro: Web Conferencing and eLearning Whitepapers
HP eBook: Guide to Storage Networking
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
webref The latest from WebReference.com Browse >
Popular JavaScript Framework Libraries: An Overview - Part 3 · Accessing Your MySQL Database from the Web with PHP · Working with the DOM Stylesheets Collection
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Crucial Triples Up With New Three-Channel DDR3 Kits · Meet the Finalists: Excellence in Technology Awards · Tealeaf Offers Insight to Mobile Customer Behavior

Created: May 14, 1996
Revised: Mar. 23, 1998
Links revised: Oct. 27, 1999

URL: http://webreference.com/dev/frames/appendix.html