Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Frames

Status
Not open for further replies.

chasdrury

IS-IT--Management
Aug 8, 2001
12
0
0
GB
Hi
I am adminisgtering a site built with frames. Search engines are picking up the pages that appear in the 'main' frame, so when people clcik the link from the search engine, they get just that page, no menus! Is there any code to tell a page that if it hasn't been loaded in the frame called main, to load itself in the 'main' frame in the document menu.html? Or is this just to far fetched?

Cheers
Charles
 
Not too sure about that - what you should have done is added some code to your metta taggs so that the sarch engines only indexed the main page. Oh well i am sure that there will be a way to fix it....

 
You could use javascript to check the value of the _TOP.location, if it is not set correctly, reload the main page in the browser. I am just improvising the code but it would go something like this......

Lets assume that
Code:
[URL unfurl="true"]http://www.myfunkysite.com/index.html[/URL]
contains two frames NAV and CONTENT. On all the pages that get loaded into the NAV or CONTENT frames include the following code

Code:
<HTML>
    <HEAD>
        <TITLE>My Funky Content Page</TITLE>
        <SCRIPT LANGUAGE='javascript'>
            function checkformat()
            {
                if( _TOP.location eq '[URL unfurl="true"]http://www.myfunkysite.com/index.html'[/URL] )
                {
                    // everything is ok, handle any other needed processing
                    return true ;
                }
                else
                {
                    _TOP.location = '[URL unfurl="true"]http://www.myfunkysite.com/index.html'[/URL] ;
                    return true ;
                }
            }
        </SCRIPT>
    </HEAD>
    <BODY onload='checkformat()'>
        ...Page code....
    </BODY>
</HTML>


Hope that helps and remember that I have not tested the code, it is just to give you an idea of how to do what you want.

B-)
 
My page is also built with frames and i have a javascript in all of my pages, except for the frameset.
By adding this javascript into all pages the frameset would be loaded if its not.
<script language=&quot;javascript&quot; type=&quot;text/javascript&quot;><!--
if (window.location.href == top.location.href)
{
//Replace frameset.html with the name of the page that contains your frameset
top.location.href = &quot;frameset.html&quot;;
}
--></script>
 
yes, all of that is good, but you (whoever) have to think how to load needed page inside your frameset
i mean you have to pass this pagename (DaFile.html) like a parameter or something..
& then in your frameset check if there was a parameter or not, & if there was, then load this file (passed) in your target frame..

must be something like that.. Victor
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top