PDA

View Full Version : Frameset: invoke "preferred" target frame



a_design_interactive
02-12-2006, 05:53 PM
hello. this is kind of difficult to describe concisely, so i apologize! i just gave you specific example to make it easier for me. thanks.

i want to create a link from a "retail music instrument store (http://www.alleycatmusic.net/bass.htm)" web site to the web site of one of their product lines (http://www.glguitars.com/frameset.htm)-- but in addition to that, i want the target URL (http://www.glguitars.com/featured%20artists/inxs/inxs.asp) to be a frame which itself doesn't have it's own "anchor" or absolute URL that i'm aware of-- because it would normally be reached only by going to the "artists" frame (bottom of first group of links of nav frame)-- as the "main" frame, after the frameset is initially loaded w/ its splash-page of course-- and only then clicking the nav which pulls the sub-page into the frameset. i realize of course that i can link directly to that frame, but i want the frameset to be loaded w/ that page-- as if the user had gone throught the process of clicking through to that sub-page.

is this possible to do w/ javascript (or another scripting, client-side or server side) that anyone is aware of? it's something i've wished to do on several occasions, but never could think how to do it. now that i've been studying scripting, i realize that it may be possible to create that type of a "link".

thanks!

jscheuer1
02-13-2006, 08:39 AM
Done entirely with javascript this is illegal across domains. However, due to a quirk in both IE6 and FF1.5.0.1 (the two most popular browsers) and perhaps others (not Opera8.51) this works:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
#hide {
visibility:hidden;
}
</style>
</head>
<body>
<a href="http://www.glguitars.com/featured%20artists/inxs/inxs.asp" target="main" onmousedown="document.getElementById('hide').style.visibility='visible'">link</a><br>
<iframe id="hide" name="gl" src="http://www.glguitars.com/frameset.htm" width="400" height="300" scrolling="auto" frameborder="0"></iframe>
</body>
</html>