Forum Moderators: open

Message Too Old, No Replies

Opening orphaned pages inside a FrameSet...

Struggling...

         

Harley_m

1:12 pm on Nov 11, 2002 (gmt 0)

10+ Year Member



Can someone help me with the code needed to open a page inside the main frameset - as would happen with a page from an SE...at the moment i am using FrameJammer - but it doesnt work so i need to do it another way...

Ive looked at the code : passpage = document.URL
if (top.location == self.location)
top.location.href="master.html?" + passpage

Then create just one "master.html" page. It holds the JavaScript code to decipher whatever URL is passed after the "?" and it writes that page into the content frame:

<html>
<head>
<title>Master Frameset</title>
</head>

<script language="JavaScript" type="text/javascript">

origURL = parent.document.URL
contentURL = origURL.substring(origURL.indexOf('?')+1, origURL.length)

document.write('<frameset cols="20%,80%"><frame src="leftnav.html" name="nav"><frame src="' + contentURL + '" name="content"><\/frameset>')

</script>

</html>

but after struggling with it for ages i need some help - im not clear what needs customising...

i have a HomePage with three frames, two Nav frame one each side of the screen, and a central content frame - where the Homepage go when the site is opened, but also where all the other page go when selected...or pages opened via SE's...

what code needs to go onto the frameset? and what needs customising...

I would be very grateful for help...

Thanks so much

Harley

tedster

1:26 pm on Nov 11, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The code for the document.write() was originally written for just two frames - in the simplest scenario, that's what you need to customize. For example:

document.write('<frameset cols="20%,60%,20%"><frame src="leftnav.html" name="navl"><frame src="' + contentURL + '" name="content"><frame src="rightnav.html" name="navr"><\/ frameset>')

Now, if one of the nav frames has several different nav pages that might be loaded, you would need to create a separate javascript for each of those options -- and then run the correct one for the potentially orphaned content page.

Harley_m

2:14 pm on Nov 11, 2002 (gmt 0)

10+ Year Member



But why do i need to assign frame widths and all that - when all i want to do is say "orphened Page Opened in Search engine.htm" - opens up into "already contructed frameset.htm" in frame B

it seems so complicated still... :(

tedster

2:52 pm on Nov 11, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Because your "already constructed" frameset loads a DIFFERENT page into the content position of the frameset.

The good part is that you can use this one frameset script for all your potentially orphaned pages.

Harley_m

3:23 pm on Nov 11, 2002 (gmt 0)

10+ Year Member



OK, when you say "Then create just one "master.html" page. It holds the JavaScript code to decipher whatever URL is passed after the "?" and it writes that page into the content frame:"

Can this code be added to my existing 3 frame frameset? or do you mean another separate page...?

tedster

6:11 pm on Nov 11, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



master.html is the one brand new page that you need to create for this approach. All the code you need is between those <html></html> tags, assuming that you customize the document.write() line appropriately.

Then these three lines of javascript should be added to, or called from, the <head> section of any potentially orphaned page:

passpage = document.URL
if (top.location == self.location)
top.location.href="master.html?" + passpage

Harley_m

7:49 pm on Nov 13, 2002 (gmt 0)

10+ Year Member



im still having hellish trouble actually getting it to work - i keep thinking ive got it sorted, only to find when i test i doesnt work :(

OK - so i create a new html file called master.html containing only the html between the <html> tags...thats easy...

but its the rest i cant seem to get right...

i know its alot to ask - and im sure you have better things to be doing - but can you explain with an applied example? assume my frameset is "homepage.html" which three frames a (20%) b (60%) and c (20%) - there are two more files, "mainpage.html" which is the homepages content page found in frame b and "otherpage.html" which is the page that would normally get orphaned...

I would be eternaly grateful if you could show me the light - i have struggled and struggled with it and its driving me nuts - cos the code isnt all that hard at all - i cant see how im failing - but i am... :(

THANK YOU SO MUCH!

Harley

tedster

9:20 pm on Nov 13, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



OK - as soon as I can free up a little time so I make sure to test it.

Please help me clarify this - as I see it, for a three panel frame page you need 5 HTML documents:

1. Regular Frameset
2. Left Frame
3. Center Frame
4. Right Frame
5. Master Frameset, scripted for orphans

Are we on the same "page" so far?

Harley_m

9:58 pm on Nov 13, 2002 (gmt 0)

10+ Year Member



yes - i have a current homepage - ThePage.htm - with the three pages a,b and c (a and c are nav - b is the middle content frame)

also we would have the separate master frameset file...

im seriously grateful...

Harley