...

View Full Version : loading frames *all the time*



loonatik
03-31-2003, 07:29 PM
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.

jalarie
03-31-2003, 07:48 PM
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';}

joh6nn
03-31-2003, 07:50 PM
http://codingforums.com/ubb/Forum4/HTML/009362.html

loonatik
03-31-2003, 07:52 PM
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.

jalarie
03-31-2003, 07:59 PM
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/

loonatik
04-02-2003, 03:14 AM
everything works. thanks.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum