...

View Full Version : Frames Java & Orphan Pages



Funkyirishman
07-24-2002, 12:26 AM
Apologies first for the length of the post.
I have a 3 frame based page at www.worldeasy.com which i want to change to a 2 frame based. I am looking for a javascript that wont give me orphan pages when a user finds it using a search engine
The frames I have at the moment is 3 frames. However I want to amend this page for 2 frames a top and bottom one. The script I am using at the moment is
<SCRIPT LANGUAGE="JAVASCRIPT" TYPE="TEXT/JAVASCRIPT">
<!-- Hide script from old browsers
if (top.location == self.location) {

self.location.replace("/?home.htm")
}
// End hiding script from old browsers -->
</SCRIPT>

This is in the head section of all of my pages that are getting indexed by the search engine which are supposed to appear in the frameset
The below I use in my index page

<SCRIPT LANGUAGE="JAVASCRIPT" TYPE="TEXT/JAVASCRIPT">
<!-- Hide script from old browsers
linkURL = "home.htm"
if (parent.document.URL) {

callingURL = parent.document.URL

if (callingURL.indexOf('?') != -1) {

linkURL = callingURL.substring(callingURL.indexOf('?')+1,callingURL.length)

}
}
document.writeln('<frameset rows="*" cols="105,692*" frameborder="NO" border="0" framespacing="0">');
document.writeln('<frame name="leftFrame" scrolling="NO" noresize src="left.htm">');
document.writeln('<frameset rows="111,*" frameborder="NO" border="0" framespacing="0" cols="*"> ');
document.writeln('<frame name="topFrame" noresize scrolling="NO" src="top.htm">');
document.writeln('<frame name="mainFrame" src=' + linkURL + '>');
document.writeln('</frameset>');
document.writeln('</frameset>');
// End hiding script from old browsers -->
</SCRIPT>

Will the above work if i only have 2 frames a top and bottom. The above takes into account a left frame which i wont have in my new design
SORRY ABOUT THE LENGTH OF THE MESSAGE

Thanks

joh6nn
07-24-2002, 09:40 AM
sure. you just have to take out the outer frameset, with the colums in it. that leaves you with the following:


<frameset rows="111,*" frameborder="NO" border="0" framespacing="0" cols="*">
<frame name="topFrame" noresize scrolling="NO" src="top.htm">
<frame name="mainFrame" src="linkURL">
</frameset>

personally, i don't like that method, though. using document.write to include the frameset, i mean. the way i've always done it, is to write the frameset as actual HTML, and then use JavaScript to set the location of the appropriate frame. IMO, it's less code, and easier to maintain. to each his own, though.

tcserpa
07-26-2002, 04:54 PM
not quite sure what i'm doing wrong.

i checked out the worldeasy.com site, noticed a slight modification of the code from the post above, put it and the frameset code in their repsective places, and it nearly works.

for some reason i can get the frameset to load up just fine, but the target frame is blank.

code for frameset :

<SCRIPT LANGUAGE="JAVASCRIPT" TYPE="TEXT/JAVASCRIPT">
<!-- Hide script from old browsers
linkURL = "index.html"
if (parent.document.URL) {

callingURL = parent.document.URL

if (callingURL.indexOf('?') != -1)

{
linkURL = callingURL.substring(callingURL.indexOf('?')+1,callingURL.length);
}
}
// -->
</SCRIPT>

with : ' +linkURL+ ' as the src for the targeted frame.

code for orphanned page head :

<SCRIPT LANGUAGE="JavaScript">
<!--
if (top == self) self.location.href = "index.html";
// -->
</SCRIPT>

it seems that the callingURL part should the orphan page URL, but it does not seem to be.

any clues?

tcserpa
07-26-2002, 05:01 PM
more from above:

to make it worse, some of the pages will require a second file (the one with the navigation) to be loaded into another frame.

these wacky frames.

tcserpa
07-26-2002, 05:10 PM
more from above :

could i put something like: ...onload"parent.navframe.location='navfile.htm'

in the pages that need it?

hmmmm....that means i don't need to put that functionality in the regular site navigation...maybe?

joh6nn
07-26-2002, 11:33 PM
here's a link to my version of what you're trying to do:
http://www.codingforums.com/newreply.php?s=&action=newreply&threadid=2573

as for you second question, yes, you could use the onload event to take care of the separate page being loaded into the navigation frame.

tcserpa
07-29-2002, 04:00 PM
hey thanks for the reply and the advice.

unfortunately the link you provided does not take me to a threaded post, rather to what appears to be a pending reply.

if you could zap out a link to the thread when you get a chance i would greatly appreciate it.

joh6nn
07-29-2002, 10:00 PM
hmm. wonder how that happened. here's the link:
http://www.codingforums.com/ubb/Forum4/HTML/009362.html

tcserpa
07-29-2002, 11:19 PM
thank you very much. it looks it's gonna do the trick.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum