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 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Jul 2002
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    FORCED FRAMES - orphan pages

    Hi

    I checked previous post and tried some java but i cannot get them to work

    I have a site at www.worldeasy.com/arsenal

    It consists of the left and right frame. I also have subpages. What I am looking for is if a user finds my page through a search engine(highly unlikely) that i wont get orphan pages. So if someone found my Liam brady page and clicked ont he link my left frame would load up along with my Liam Brady page onthe right ?

    Anyone got any ideas or some script that will do the trick

    eternally greatful

    Keith

  • #2
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    try this:

    PHP Code:
    <script language="JavaScript">

    // This Javascript routine checks the files loaded in the frames and
    // changes them only if different. Check if there are any frames first!

        
    if(parent.frames.length!=0){

    // check menu.location

        
    newDocument="menu2.html";
        if(
    parent.menu.location.href.lastIndexOf(newDocument)==-1){
        
    parent.menu.location=newDocument;
        }
    }
    </script>

    The routine searches through the location.href property (of the document in the menu target frame) for the newDocument string. If it is found then there is no need to change the menu. 
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #3
    New to the CF scene
    Join Date
    Jul 2002
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Forced Frames and Orphan Pages

    Cheers

    Do you put this in all the pages ?

    Also the menu what do you replace that with your main home page that appears on the index.htm ?

    Thanks

  • #4
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    insert that script in each frame.

    using that code you build a function called on onload. Now that function will check if the parent frame exists or not. If exists, nothing happens, If not, the script will redirect the browser towards the full page (with parent frame).

    menu2.html.... use instead of this your parent.frame name
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*


  •  

    Posting Permissions

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