Changing the parent with the child

liunx

Guest
:confused: I know that I can use "_blank" to open another window when a link is clicked, but whenever a link inside that window is clicked, the resultant page is opened inside that same window (or another). How can I make it so that when a link is clicked inside the newly opened window, the window closes and the desired page comes up in the original main window? Does anybody know how this can be done?<!--content-->Originally posted by Wallee How can I make it so that when a link is clicked inside the newly opened window, the window closes and the desired page comes up in the original main window? Does anybody know how this can be done? [/B] <br />
<br />
You need to make the first page loaded in a frameset (you can have frameset with only 1 frame).<br />
Then you specify a name for that frame, eg main.<br />
<br />
Then you make your link in your new page target="main".<br />
<br />
You can find specifics here<br />
<!-- m --><a class="postlink" href="http://www.w3.org/TR/html4/present/frames.html">http://www.w3.org/TR/html4/present/frames.html</a><!-- m --><br />
<br />
Altearnativly you can do it with JavaScript too, but that will break if JavaScript is not available in the visitors browser.<!--content-->Thanks<!--content-->Originally posted by Dave Clark <br />
I have never seen a target that is able to find a named frame that is not in the same browser window. <br />
<br />
Take a peak at this code then for a new experience ;)<br />
<br />
Index.html<br />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"><br />
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><br />
<head><br />
<title></title><br />
</head><br />
<frameset border="0"> <!-- border="0" is a bugfix for IE, NS as well as Opera --><br />
<frame name="main" src=http://www.webdeveloper.com/forum/archive/index.php/"initial.html" frameborder="0" marginwidth="1" marginheight="1" scrolling="auto" /><br />
<noframes><br />
<body><br />
<p><br />
Frames are not working in your Browser.<br /><br />
If you have Frames turned off, please turn it on to view this site.<br />
</p><br />
</body><br />
</noframes><br />
</frameset><br />
</html><br />
<br />
<br />
initial.html<br />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><br />
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><br />
<head><br />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><br />
<meta http-equiv="Content-Script-Type" content="text/javascript" /><br />
<meta http-equiv="Content-Style-Type" content="text/css" /><br />
<title></title><br />
</head><br />
<body><br />
<br />
<p><br />
<a target="_blank" href=http://www.webdeveloper.com/forum/archive/index.php/"blank.html">open _blank</a><br />
</p><br />
<br />
</body><br />
</html><br />
<br />
<br />
blank.html<br />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><br />
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><br />
<head><br />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><br />
<meta http-equiv="Content-Script-Type" content="text/javascript" /><br />
<meta http-equiv="Content-Style-Type" content="text/css" /><br />
<title></title><br />
<link rel="stylesheet" title="Default" media="screen" href=http://www.webdeveloper.com/forum/archive/index.php/"main.css" type="text/css" /><br />
</head><br />
<body><br />
<br />
<p><br />
<a target="main" href=http://www.webdeveloper.com/forum/archive/index.php/"blank.html">open in main</a><br />
</p><br />
<br />
</body><br />
</html><!--content-->
 
Back
Top