Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Frames question 1

Status
Not open for further replies.

funkymonk

Technical User
Dec 18, 2000
588
GB
Is it possible to open the browser to a specific HTML frames document and dynamically specify the HTML document to be displayed in either frame?
funkymonk2.jpg


funkymonk@blueyonder.co.uk
********************
 
yes. =========================================================
if (!succeed) try();
-jeff
 
How then :)
funkymonk2.jpg


funkymonk@blueyonder.co.uk
********************
 
depends on what you're doing...is the frameset a new window, being opened by another? or do you want the frameset itself to set its own contents?



=========================================================
if (!succeed) try();
-jeff
 
I have a non framed page (front page of an Intranet) with various links.

I want each link to open the same frameset (frame.htm) but with a navigation page (in the left nav frame) relating to the link that was clicked ie. businessplanNav.htm / teamdayNav.htm /monthlyreportsNav.htm etc.

Is this possible?

Please note that I have no javascript knowledge.
funkymonk2.jpg


funkymonk@blueyonder.co.uk
********************
 
Assuming your right frame was named TEXT the beginning left frame would need to look something like this:

<html>
<head><title>Switch Frames</title></head>
<body>
<div align=&quot;center&quot;>
<h3>Contents</h3><br /><br /><hr>
<table>
<tr><th><a href=&quot;right01.htm&quot; target=&quot;TEXT&quot;
onClick='window.self.location=&quot;left01.htm&quot;'>
Frame 1
</a></th></tr>
<tr><th><a href=&quot;right02.htm&quot; target=&quot;TEXT&quot;
onClick='window.self.location=&quot;left02.htm&quot;'>
Frame 2
</a></th></tr>
</table>
<hr></div></body></html>

each new left navigation page would need a link back to the contents page.

HTH,
Clive
 
Hi Clive,

Sorry but I don't think you understood my question.

Linking to pages once I'm in the frameset is not a problem (yet :)). Is this what you were saying?

I'm coming from a non framed page (the frameset has not been loaded yet) and when I click a link from this page I then want the frameset to load with the relevant nav page in the nav frame of the frameset, depending on what link I clicked.
funkymonk2.jpg


funkymonk@blueyonder.co.uk
********************
 
hi funkymonk,

you can do something like this for the frameset:

Code:
<html>
<head>
<title>frameset</title>

<script language=&quot;javascript&quot;>
var sFrame = location.search.split(&quot;=&quot;)[1];
var sHTML = '<frameset cols=&quot;25%,*&quot;>' +
	'<frame name=&quot;left&quot; src=&quot;nav.html&quot;>' +
	'<frame name=&quot;right&quot; src=&quot;' + sFrame + '&quot;' +
	'</frameset>';

document.write(sHTML);
</script>

</head>
</html>


from your intranet home page, your links will be like:

<a href=&quot;frameset.html?frame=one.html&quot;>page one</a>
<a href=&quot;frameset.html?frame=two.html&quot;>page two</a>


this will open the nav page on the left, and whatever page is passed as &quot;frame=&quot; on the right.
=========================================================
if (!succeed) try();
-jeff
 
Thanks Jef, I will have a play with this and see if I can apply it to the frameset I have as it's a little different from the frameset that you've done above. If I get any problems I'll come back and ask.

Thanks again
funkymonk2.jpg


funkymonk@blueyonder.co.uk
********************
 
Jeff

You are a star! Well 2 actually :).

I had to get some help to apply it to the frameset I had and it did need a little modification (no idea what was done, our developer guy doesn't know JavaScript but did see where you were coming from and was able to do the modifying).

I am now going to hit my deadline, thank you!

Regards
funkymonk2.jpg


funkymonk@blueyonder.co.uk
********************
 
I have a Jscript in my pages, and if they detect that they are not in the browser it will open the frameset(IFRAME) page with the addition of:

?file&&&/C:/Website/about2.htm

there is a script in the frameset page to detect this string:

defaultsubpage=&quot;home.htm&quot;;
if (location.search) {subpage=location.search.substring(1)}
else {subpage=defaultsubpage}

if (subpage.indexOf('&&&')>=0) {
prefix=subpage.substring(0,subpage.indexOf('&&&'))+&quot;://&quot;;
suffix=subpage.substring(subpage.indexOf('&&&')+3,subpage.length);
subpage=prefix+suffix;
// this is where I want frame.src = subpage
// as you can tell I don't know the DOM for this
}

This code will be in the head of the frameset, which isn't actually a frameset, but a page with an IFRAME.
Thus I am not calling the parent window (i think)

HOW!!??!!

thanks Mixed Linux/Win2000 Network Administrator
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top