Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    New to the CF scene
    Join Date
    Jul 2002
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Frames Java & Orphan Pages

    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

  • #2
    Senior Coder joh6nn's Avatar
    Join Date
    Jun 2002
    Location
    72° W. 48' 57" , 41° N. 32' 04"
    Posts
    1,887
    Thanks
    0
    Thanked 1 Time in 1 Post
    sure. you just have to take out the outer frameset, with the colums in it. that leaves you with the following:

    Code:
    <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.
    bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

    i am a loser geek, crazy with an evil streak,
    yes i do believe there is a violent thing inside of me.

  • #3
    New Coder
    Join Date
    Jul 2002
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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___
    uuuuh...what?

  • #4
    New Coder
    Join Date
    Jul 2002
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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___
    uuuuh...what?

  • #5
    New Coder
    Join Date
    Jul 2002
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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?
    __tcserpa___
    uuuuh...what?

  • #6
    Senior Coder joh6nn's Avatar
    Join Date
    Jun 2002
    Location
    72° W. 48' 57" , 41° N. 32' 04"
    Posts
    1,887
    Thanks
    0
    Thanked 1 Time in 1 Post
    here's a link to my version of what you're trying to do:
    http://www.codingforums.com/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.
    bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

    i am a loser geek, crazy with an evil streak,
    yes i do believe there is a violent thing inside of me.

  • #7
    New Coder
    Join Date
    Jul 2002
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.
    __tcserpa___
    uuuuh...what?

  • #8
    Senior Coder joh6nn's Avatar
    Join Date
    Jun 2002
    Location
    72° W. 48' 57" , 41° N. 32' 04"
    Posts
    1,887
    Thanks
    0
    Thanked 1 Time in 1 Post
    hmm. wonder how that happened. here's the link:
    http://www.codingforums.com/ubb/Forum4/HTML/009362.html
    bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

    i am a loser geek, crazy with an evil streak,
    yes i do believe there is a violent thing inside of me.

  • #9
    New Coder
    Join Date
    Jul 2002
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thank you very much. it looks it's gonna do the trick.
    __tcserpa___
    uuuuh...what?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •