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 6 of 6
  1. #1
    New Coder
    Join Date
    Mar 2003
    Posts
    64
    Thanks
    0
    Thanked 0 Times in 0 Posts

    loading frames *all the time*

    I have a site in frames. So the the default page is index.html and it loads menu.html and main.html. Let's say someone goes to my site by going to www.mysitehere.com/main.html instead, is there a way using javascript to load each internal page (i.e. main.html) to be in a frame? So that when someone goes to www.mysitehere.com/main.html it automatically loads with menu.html also. Do I need a php script instead? Thanks.
    Last edited by loonatik; 03-31-2003 at 06:37 PM.

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    Flint, Michigan, USA
    Posts
    620
    Thanks
    1
    Thanked 20 Times in 20 Posts
    Have your page check to see if it is within frames, and jump to index.html if not:

    if (self == top) {top.location='index.html';}

  • #3
    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
    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.

  • #4
    New Coder
    Join Date
    Mar 2003
    Posts
    64
    Thanks
    0
    Thanked 0 Times in 0 Posts
    oic thanks.
    -----
    sorry, i should've been more specific.

    i actually want the effect to be the same for all other internal pages. for example, there's a link in main that goes to main2.html. so when someone goes to www.mysitehere.com/main2.html it'll also load the menu.html. so just redirecting to index.html would not work cuz that would just load the menu and main.html and not main2.html.

    thanks.

  • #5
    Regular Coder
    Join Date
    Jun 2002
    Location
    Flint, Michigan, USA
    Posts
    620
    Thanks
    1
    Thanked 20 Times in 20 Posts
    If the page is not within frames, link to index2.html?pageID. The index2.html link goes to either a CGI routine or a JavaScript-enabled page (your choice; either would work) which pulls the query string and puts the menu and target pages within the frameset constructed on-the-fly.

    You can see this concept in action at my site. Go to the link below, wait for the frames to show up, click on the header of the lower-right frame, move around a bit, then click on the "Return to frames" link at the bottom of whatever page is then current. The site address is:

     http://spruce.flint.umich.edu/~jalarie/

  • #6
    New Coder
    Join Date
    Mar 2003
    Posts
    64
    Thanks
    0
    Thanked 0 Times in 0 Posts
    everything works. thanks.


  •  

    Posting Permissions

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