RE: Scripts to load frames?

by "tim booker" <timbooker(at)btinternet.com>

 Date:  Fri, 7 Apr 2000 23:43:28 +0100
 To:  "'The Lion's Cub'" <lionscub(at)elknet.net>,
"'HWG -- Techniques'" <hwg-techniques(at)hwg.org>
 In-Reply-To:  lionscub
  todo: View Thread, Original
http://www.webbedenvironments.com/v02/02_15.html




>>>>>>>>>>>>>> http://www.timbooker.co.uk/


> -----Original Message-----
> From: owner-hwg-techniques(at)hwg.org
> [mailto:owner-hwg-techniques(at)hwg.org]On Behalf Of The Lion's Cub
> Sent: 05 April 2000 01:20
> To: HWG -- Techniques
> Subject: Scripts to load frames?
> 
> 
> I found this simple little script that allows me to check and 
> see if my
> pages are being displayed inside my frameset or solo.  
> Several pages are
> purely navigational, or simply part of the look and feel of 
> the site.  These
> pages simply point back to the index.html which is my 
> frameset, and load
> properly.
> 
> The main pages I have modified the script to include a small 
> paragraph that
> the page is best viewed in a frame and then display the menu. 
>  If a user is
> already in frames then they do not see this menu, or the 
> paragraph.  Its a
> neat trick and I like the results up to a point.
> 
> Is there a way to load the frameset, and override the main 
> page with the
> calling pages name.  example the frameset is designed to load 
> with main.html
> as the content section.  Lets say the user clicks on the 
> content1.html page
> and sees the link to the frameset.  If the click on the 
> frameset they get
> sent back to main.html instead of just pulling up the frameset with
> content1.html loaded.
> 
> The easy solution is to create a seperate frameset document 
> for each content
> page. What I want however is to be able to add a snippit of 
> code to every
> page that I do not have to modify.  Since others will be 
> designing some of
> the content pages, I would like to be able to just add the 
> code to but the
> frameset option at the end of there page and upload to the 
> server.  The
> following is the snippet of code as I have it now.
> 
> <SCRIPT language=JavaScript type=text/javascript><!--
> text1=("");
> text2=("");
> 
> if (top.location == location) { text1=('<p>This website was 
> designed to
> utilize frames.  The page you are viewing is being viewed 
> without the aide
> of the navigational user interface.  It is the considered 
> opinion of the
> websites designer that you <a href="./">click here to 
> view this
> webpage as it was intended to be viewed!</a></p>');}
> 
> if (top.location == location) { text2=('<p align="center"> [ &nbsp; <a
> href="huronmain.html"> Main Page </a>  &nbsp; &brvbar; &nbsp;  <a
> href="crew/crewmanifest.html"> Crew Manifest </a> &nbsp; 
> &brvbar;  &nbsp; <a
> href="copyright.html"> Copyright </a>  &nbsp; ]</p>');}
> 
> document.write(text1);
> document.write(text2);
> / / -->
> </SCRIPT>
> 
> 

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA