Google Answers Logo
View Question
 
Q: Force redirect to frameset ( Answered,   0 Comments )
Question  
Subject: Force redirect to frameset
Category: Computers > Programming
Asked by: jhabley-ga
List Price: $10.00
Posted: 01 Jul 2003 18:58 PDT
Expires: 31 Jul 2003 18:58 PDT
Question ID: 224095
I have two web sites.

1. A regular multi-page site at http://www.abc.com/forums/ (sample URL
only)
2. A frameset at http://www.abc.com/mainmenu/ (sample URL only) which
has two frames: 'left' and 'right'. In 'left' are three links -- one
goes to the /forums/ site.

Many people have bookmarked the /forums/ URL, but I'd prefer that they
start at the /mainmenu/ site so they can see the other two link
options in the mainmenu's left frame.

Here's my question: How do I make it so that anytime someone visits a
page at /forums/, they get redirected to that page, but inside the
/mainmenu/ frameset?
Answer  
Subject: Re: Force redirect to frameset
Answered By: dewolfe001-ga on 01 Jul 2003 19:16 PDT
 
What you can do is use Javascript to see if you have a Frames
environment. If you  are not in a frames environment (hence the
!top.frames[1] line-- (! means not or untrue)), it will relocate the
user to a frameset page that builds the frames. Replace
"frame_framed.html" with the frameset page for your site-- or use a
full web address (e.g.
http://www.dewolfe.bc.ca/web/javascript/frame_framed.html).

If you put the following HTML near the top of your forum page, it will
force users into a frames environment should they try to open the
forum in a window of its own:

<HTML>
<HEAD>
<SCRIPT language="JavaScript">

<!--
function Framed()
{
if (!top.frames[1]) 
	{
	location.href = "frame_framed.html"
	}
}
// -->
</SCRIPT>
</HEAD>
<body onLoad="Framed()";>
<font face="arial">

</body>
</html>

An example of this use can be found at:
http://www.dewolfe.bc.ca/web/javascript/frame_framed.html
Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy