?
Solved

Subpages and Frames...

Posted on 1998-05-05
9
Medium Priority
?
213 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 500 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
Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

 
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

WordPress Tutorial 2: Terminology

An important part of learning any new piece of software is understanding the terminology it uses. Thankfully WordPress uses fairly simple names for everything that make it easy to start using the software.

Question has a verified solution.

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

FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

743 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