Solved

Subpages and Frames...

Posted on 1998-05-05
9
211 Views
Last Modified: 2013-12-25
When you first come to my site, I have three frames set up.  A banner up top, table of contents on the left, and the main on the right.  My question is this, is there anyway for me to access a subpage directly and have the frames load?  The reason I'm asking is because I'd like to submit my subpages to the search engines, and when the user clicks on the link, have the frames load, and then the subpage load in the main frame.  If this sounds confusing let me know.  Thanks for the help!
0
Comment
Question by:ingenito
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
9 Comments
 

Author Comment

by:ingenito
ID: 1855312
Here's another way of putting it.  The user searches on a search engine for videos.  They see a link to my site about Windows Videos.  How can I have the user click on the link and have the frames load with the Windows Video information and not just to my main page?  I am willing to use Javascript but I don't want a seperate frame source on each page (I have over 200 pages) nor do I want a cgi script to do it.  Is there any way to do this?
0
 
LVL 3

Accepted Solution

by:
percyn earned 250 total points
ID: 1855313
Yes.
    You have to check the number of frames (frames.length) on each page and if the frames.length<1, then load the frameset by using location.href="myframeset.html"


0
 

Author Comment

by:ingenito
ID: 1855314
I'm sorry, but I don't understand.  Are you saying to put this code on every 'content' page to check for the frames?  If you are, then wouldn't the location.href="myframeset.htm" load the main page? I'm very familiar with javascript.  If you could, an example would be great.
0
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 
LVL 5

Expert Comment

by:julio011597
ID: 1855315
It seems you could put something like this in each of your subpages:

--//--
<HTML>
  <HEAD>
    <SCRIPT LANGUAGE="Javascript"><!--
      if(!self.parent) self.location.href = "myFrameset.htm";
    // --></SCRIPT>
  </HEAD>
  <BODY>
    ...
  </BODY>
</HTML>
--//--

Is this what you meant?

-julio
0
 
LVL 5

Expert Comment

by:julio011597
ID: 1855316
BTW, i guess this is what percyn also meant... but, shouldn't be: top.frames.length?
0
 
LVL 3

Expert Comment

by:percyn
ID: 1855317
Yes,
    Check the top.frame.length and if it is <1, load up a frameset. How remember that you can load a frameset which loads one static page (like a menu) and another page which uses Script or CGI/ASP to accept a frame src as a passed parameter. Thus if you have 200 pages, you dont need 200 framesets, just one frameset, which can accept an argument to load any of the 200 frames.
0
 

Author Comment

by:ingenito
ID: 1855318
Since I want the content pages to be submitted to the search engines, I can't have it be a CGI script.  I think I figured it out though, please tell me if this implementation is practical.

On each of the pages I have added this just before the body tag:

<script language="javascript">
<!--

if(!top.frames.length){
document.writeln('<frameset framespacing="0" border="false" frameborder="0" rows="65,*">');
document.writeln('  <frame name="banner" scrolling="no" noresize target="contents" src="../../banner.htm" marginwidth="0" marginheight="0">');
document.writeln('  <frameset cols="192,*">');
document.writeln('    <frame name="contents" target="main" src="../../contents.htm" scrolling="no" noresize marginwidth="0" marginheight="0">');
document.writeln('    <frame name="main" src="account.htm" scrolling="auto">');
document.writeln('  </frameset>');
main.location.href="account.htm";
}

<!-- end of script -->
</script>

Now, this seems to work perfectly in MSIE 4.0 but not Netscape.  Can someone tell me why?
0
 
LVL 3

Expert Comment

by:percyn
ID: 1855319
top.frames.length is an int, not a boolean. Check for the exact value, i.e. 0,1,2,3, etc.



0
 

Author Comment

by:ingenito
ID: 1855320
It still doesn't work, if you'd like the page URL is http://www.corporatetrain.com/software/accounting/account.htm

Please take a look and let me know if you can tell what's wrong...
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question